Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/du/tests/du_test.sh
Show All 26 Lines | |||||
atf_test_case A_flag | atf_test_case A_flag | ||||
A_flag_head() | A_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify -A behavior" | atf_set "descr" "Verify -A behavior" | ||||
} | } | ||||
A_flag_body() | A_flag_body() | ||||
{ | { | ||||
# XXX: compressed volumes? | # XXX: compressed volumes? | ||||
atf_check truncate -s 10g sparse.file | if ! truncate -s 10g sparse.file; then | ||||
atf_skip "Unable to create 10GB sparse file (running on tmpfs?)" | |||||
rm -f sparse.file | |||||
fi | |||||
atf_check -o inline:'1\tsparse.file\n' du -g sparse.file | atf_check -o inline:'1\tsparse.file\n' du -g sparse.file | ||||
atf_check -o inline:'10\tsparse.file\n' du -A -g sparse.file | atf_check -o inline:'10\tsparse.file\n' du -A -g sparse.file | ||||
} | } | ||||
atf_test_case H_flag | atf_test_case H_flag | ||||
H_flag_head() | H_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify -H behavior" | atf_set "descr" "Verify -H behavior" | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
atf_set "descr" "Verify -g output" | atf_set "descr" "Verify -g output" | ||||
} | } | ||||
g_flag_body() | g_flag_body() | ||||
{ | { | ||||
atf_check truncate -s 1k A | atf_check truncate -s 1k A | ||||
atf_check truncate -s 1m B | atf_check truncate -s 1m B | ||||
atf_check truncate -s 1g C | atf_check truncate -s 1g C | ||||
atf_check truncate -s 1t D | if ! truncate -s 1t D; then | ||||
atf_skip "Unable to create 1T sparse file (running on tmpfs?)" | |||||
rm -f A B C D | |||||
fi | |||||
atf_check -o inline:'1\tA\n1\tB\n1\tC\n1024\tD\n' du -Ag A B C D | atf_check -o inline:'1\tA\n1\tB\n1\tC\n1024\tD\n' du -Ag A B C D | ||||
} | } | ||||
atf_test_case h_flag | atf_test_case h_flag | ||||
h_flag_head() | h_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify -h output" | atf_set "descr" "Verify -h output" | ||||
} | } | ||||
h_flag_body() | h_flag_body() | ||||
{ | { | ||||
atf_check truncate -s 1k A | atf_check truncate -s 1k A | ||||
atf_check truncate -s 1m B | atf_check truncate -s 1m B | ||||
atf_check truncate -s 1g C | atf_check truncate -s 1g C | ||||
atf_check truncate -s 1t D | if ! truncate -s 1t D; then | ||||
atf_skip "Unable to create 1T sparse file (running on tmpfs?)" | |||||
rm -f A B C D | |||||
fi | |||||
atf_check -o inline:'1.0K\tA\n1.0M\tB\n1.0G\tC\n1.0T\tD\n' du -Ah A B C D | atf_check -o inline:'1.0K\tA\n1.0M\tB\n1.0G\tC\n1.0T\tD\n' du -Ah A B C D | ||||
} | } | ||||
atf_test_case k_flag | atf_test_case k_flag | ||||
k_flag_head() | k_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify -k output" | atf_set "descr" "Verify -k output" | ||||
} | } | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |