Date: Fri, 2 Oct 2015 08:13:46 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r288480 - user/ngie/more-tests/bin/ls/tests Message-ID: <201510020813.t928DkFt074852@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Fri Oct 2 08:13:45 2015 New Revision: 288480 URL: https://svnweb.freebsd.org/changeset/base/288480 Log: Add a testcase to test ls -s; remove an unnecessary sync Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh ============================================================================== --- user/ngie/more-tests/bin/ls/tests/ls_tests.sh Fri Oct 2 07:26:24 2015 (r288479) +++ user/ngie/more-tests/bin/ls/tests/ls_tests.sh Fri Oct 2 08:13:45 2015 (r288480) @@ -304,9 +304,31 @@ q_flag_and_w_flag_body() atf_check -e empty -o match:"$test_file" -s exit:0 ls -w "$test_file" } +s_flag_head() +{ + atf_set "descr" "Verify that the output from ls -s matches the output from stat(1)" +} + +s_flag_body() +{ + create_test_dir + + for filesize in 512 1 2048 10240 $(( 512 * 1024 )); do + atf_check -e ignore -o empty -s exit:0 \ + dd if=/dev/zero of=${filesize}.file bs=${filesize} count=1 + files="${files} ${filesize}.file" + done + + for file in $files; do + atf_check -e empty \ + -o match:"$(stat -f "%b" $file)[[:space:]]+$file" ls -s $file + stat -f "%b" $file + done +} + t_flag_head() { - atf_set "descr" "Verify that the output from ls -u sorts by last access with -t" + atf_set "descr" "Verify that the output from ls -t sorts by modification time" } t_flag_body() @@ -314,7 +336,6 @@ t_flag_body() create_test_dir atf_check -e empty -o empty -s exit:0 touch a.file - sync atf_check -e empty -o empty -s exit:0 touch b.file sync @@ -461,7 +482,7 @@ atf_init_test_cases() #atf_add_test_case p_flag atf_add_test_case q_flag_and_w_flag #atf_add_test_case r_flag - #atf_add_test_case s_flag + atf_add_test_case s_flag atf_add_test_case t_flag atf_add_test_case u_flag atf_add_test_case x_flag
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510020813.t928DkFt074852>