No empty .Rs/.Re
[netbsd-mini2440.git] / tests / util / df / t_df.sh
blob44eb25cb6600256a290cf70fa035e401c92518a2
1 # $NetBSD: t_df.sh,v 1.2 2008/04/30 13:11:00 martin Exp $
3 # Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
4 # All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
28 atf_test_case normal
29 normal_head() {
30 atf_set "descr" "Checks that the output of df without flags is" \
31 "correct according to some already-known, sane" \
32 "output"
34 normal_body() {
35 cat >expout <<EOF
36 Filesystem 1K-blocks Used Avail %Cap Mounted on
37 filer:/ 1202716672 135168 1202581504 0% /filer
38 filer:/ 1202716672 0 1202716672 0% /filer
39 filer:/ 1202716672 240543334 962173337 20% /filer
40 filer:/ 1202716672 721630003 481086668 60% /filer
41 filer:/ 1202716672 1142580838 60135833 95% /filer
42 filer:/ 1202716672 1202716672 0 100% /filer
43 filer:/ 1202716672 0 1142580838 0% /filer
44 filer:/ 1202716672 240543334 902037504 21% /filer
45 filer:/ 1202716672 721630003 420950835 63% /filer
46 filer:/ 1202716672 1142580838 0 100% /filer
47 filer:/ 1202716672 1202716672 -60135833 105% /filer
48 filer:/ 1202716672 0 1082445004 0% /filer
49 filer:/ 1202716672 240543334 841901670 22% /filer
50 filer:/ 1202716672 721630003 360815001 66% /filer
51 filer:/ 1202716672 1142580838 -60135833 105% /filer
52 filer:/ 1202716672 1202716672 -120271667 111% /filer
53 filer:/ 1202716672 0 1022309171 0% /filer
54 filer:/ 1202716672 240543334 781765836 23% /filer
55 filer:/ 1202716672 721630003 300679168 70% /filer
56 filer:/ 1202716672 1142580838 -120271667 111% /filer
57 filer:/ 1202716672 1202716672 -180407500 117% /filer
58 /dev/ld0g 1308726116 17901268 1225388540 1% /anon-root
59 /dev/ld0g 1308726116 0 1308726116 0% /anon-root
60 /dev/ld0g 1308726116 261745224 1046980892 20% /anon-root
61 /dev/ld0g 1308726116 785235672 523490444 60% /anon-root
62 /dev/ld0g 1308726116 1243289812 65436304 95% /anon-root
63 /dev/ld0g 1308726116 1308726116 0 100% /anon-root
64 /dev/ld0g 1308726116 0 1243289808 0% /anon-root
65 /dev/ld0g 1308726116 261745224 981544584 21% /anon-root
66 /dev/ld0g 1308726116 785235672 458054140 63% /anon-root
67 /dev/ld0g 1308726116 1243289812 0 100% /anon-root
68 /dev/ld0g 1308726116 1308726116 -65436304 105% /anon-root
69 /dev/ld0g 1308726116 0 1177853504 0% /anon-root
70 /dev/ld0g 1308726116 261745224 916108280 22% /anon-root
71 /dev/ld0g 1308726116 785235672 392617832 66% /anon-root
72 /dev/ld0g 1308726116 1243289812 -65436304 105% /anon-root
73 /dev/ld0g 1308726116 1308726116 -130872608 111% /anon-root
74 /dev/ld0g 1308726116 0 1112417196 0% /anon-root
75 /dev/ld0g 1308726116 261745224 850671972 23% /anon-root
76 /dev/ld0g 1308726116 785235672 327181528 70% /anon-root
77 /dev/ld0g 1308726116 1243289812 -130872608 111% /anon-root
78 /dev/ld0g 1308726116 1308726116 -196308916 117% /anon-root
79 /dev/strpct 21474836476 10737418240 10737418236 50% /strpct
80 /dev/wd0e 10485688 2859932 7625756 27% /mount/windows/C
81 EOF
82 atf_check -s eq:0 -o file:expout -e empty \
83 -x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df"
86 atf_test_case hflag
87 hflag_head() {
88 atf_set "descr" "Checks that the output of df is correct according" \
89 "to some already-known, sane output when using the" \
90 "human readable format"
92 hflag_body() {
93 cat >expout <<EOF
94 Filesystem Size Used Avail %Cap Mounted on
95 filer:/ 1.1T 132M 1.1T 0% /filer
96 filer:/ 1.1T 0B 1.1T 0% /filer
97 filer:/ 1.1T 229G 918G 20% /filer
98 filer:/ 1.1T 688G 459G 60% /filer
99 filer:/ 1.1T 1.1T 57G 95% /filer
100 filer:/ 1.1T 1.1T 0B 100% /filer
101 filer:/ 1.1T 0B 1.1T 0% /filer
102 filer:/ 1.1T 229G 860G 21% /filer
103 filer:/ 1.1T 688G 401G 63% /filer
104 filer:/ 1.1T 1.1T 0B 100% /filer
105 filer:/ 1.1T 1.1T -57G 105% /filer
106 filer:/ 1.1T 0B 1.0T 0% /filer
107 filer:/ 1.1T 229G 803G 22% /filer
108 filer:/ 1.1T 688G 344G 66% /filer
109 filer:/ 1.1T 1.1T -57G 105% /filer
110 filer:/ 1.1T 1.1T -115G 111% /filer
111 filer:/ 1.1T 0B 975G 0% /filer
112 filer:/ 1.1T 229G 746G 23% /filer
113 filer:/ 1.1T 688G 287G 70% /filer
114 filer:/ 1.1T 1.1T -115G 111% /filer
115 filer:/ 1.1T 1.1T -172G 117% /filer
116 /dev/ld0g 1.2T 17G 1.1T 1% /anon-root
117 /dev/ld0g 1.2T 0B 1.2T 0% /anon-root
118 /dev/ld0g 1.2T 250G 998G 20% /anon-root
119 /dev/ld0g 1.2T 749G 499G 60% /anon-root
120 /dev/ld0g 1.2T 1.2T 62G 95% /anon-root
121 /dev/ld0g 1.2T 1.2T 0B 100% /anon-root
122 /dev/ld0g 1.2T 0B 1.2T 0% /anon-root
123 /dev/ld0g 1.2T 250G 936G 21% /anon-root
124 /dev/ld0g 1.2T 749G 437G 63% /anon-root
125 /dev/ld0g 1.2T 1.2T 0B 100% /anon-root
126 /dev/ld0g 1.2T 1.2T -62G 105% /anon-root
127 /dev/ld0g 1.2T 0B 1.1T 0% /anon-root
128 /dev/ld0g 1.2T 250G 874G 22% /anon-root
129 /dev/ld0g 1.2T 749G 374G 66% /anon-root
130 /dev/ld0g 1.2T 1.2T -62G 105% /anon-root
131 /dev/ld0g 1.2T 1.2T -125G 111% /anon-root
132 /dev/ld0g 1.2T 0B 1.0T 0% /anon-root
133 /dev/ld0g 1.2T 250G 811G 23% /anon-root
134 /dev/ld0g 1.2T 749G 312G 70% /anon-root
135 /dev/ld0g 1.2T 1.2T -125G 111% /anon-root
136 /dev/ld0g 1.2T 1.2T -187G 117% /anon-root
137 /dev/strpct 20T 10T 10T 50% /strpct
138 /dev/wd0e 10G 2.7G 7.3G 27% /mount/windows/C
140 atf_check -s eq:0 -o file:expout -e empty \
141 -x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df -h"
144 atf_init_test_cases()
146 atf_add_test_case normal
147 atf_add_test_case hflag