|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src |
|
|
print_ver_ df |
|
|
|
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
df: options OPT and --output are mutually exclusive |
|
|
Try 'df --help' for more information. |
|
|
EOF |
|
|
|
|
|
df -i --output '.' 2>out && fail=1 |
|
|
sed 's/ -i / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df --output -i '.' 2>out && fail=1 |
|
|
sed 's/ -i / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df -P --output '.' 2>out && fail=1 |
|
|
sed 's/ -P / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df --output -P '.' 2>out && fail=1 |
|
|
sed 's/ -P / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df -T --output '.' 2>out && fail=1 |
|
|
sed 's/ -T / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df --output -T '.' 2>out && fail=1 |
|
|
sed 's/ -T / OPT /' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
df: option --output: field 'target' used more than once |
|
|
Try 'df --help' for more information. |
|
|
EOF |
|
|
|
|
|
df --output=target,source,target '.' 2>out && fail=1 |
|
|
compare exp out || fail=1 |
|
|
|
|
|
|
|
|
df --out=target,source --out=target '.' 2>out && fail=1 |
|
|
compare exp out || fail=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
Filesystem Type Inodes IUsed IFree IUse% Size Used Avail Use% File Mounted on |
|
|
EOF |
|
|
|
|
|
df -h --o=source,fstype,itotal,iused,iavail,ipcent \ |
|
|
--o=size,used,avail,pcent,file,target '.' >out || fail=1 |
|
|
sed -e '1 { |
|
|
s/ [ ]*/ /g |
|
|
q |
|
|
}' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
df -h --output '.' >out || fail=1 |
|
|
sed -e '1 { |
|
|
s/ [ ]*/ /g |
|
|
q |
|
|
}' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
1K-blocks |
|
|
EOF |
|
|
|
|
|
df -B1K --output=size '.' >out || fail=1 |
|
|
sed -e '1 { |
|
|
s/ *// |
|
|
q |
|
|
}' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
- |
|
|
EOF |
|
|
|
|
|
df --output=source,target --total '.' >out || fail=1 |
|
|
sed -n -e '3 { |
|
|
s/^total[ ]*// |
|
|
p |
|
|
q |
|
|
}' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
total |
|
|
EOF |
|
|
|
|
|
df --output=target --total '.' >out || fail=1 |
|
|
sed -n -e '3 { |
|
|
p |
|
|
q |
|
|
}' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
|
|
|
df --help > out || fail=1 |
|
|
grep ' --output' out >/dev/null || { fail=1; cat out; } |
|
|
|
|
|
|
|
|
cat <<\EOF > exp || framework_failure_ |
|
|
. |
|
|
exp |
|
|
EOF |
|
|
|
|
|
df --output=file '.' exp >out || fail=1 |
|
|
sed '1d' out > out2 |
|
|
compare exp out2 || fail=1 |
|
|
|
|
|
Exit $fail |
|
|
|