summaryrefslogtreecommitdiffstats
path: root/bin/ls
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-10-30 20:14:32 +0000
committeremaste <emaste@FreeBSD.org>2015-10-30 20:14:32 +0000
commitd7f5735176108a79c2472374356b6f9657eb4365 (patch)
tree65f31312110f87456debfc26e2ceab6ba0d07221 /bin/ls
parenteddc63a9989aa0d38423a71fef3d817c7ddb9d57 (diff)
downloadFreeBSD-src-d7f5735176108a79c2472374356b6f9657eb4365.zip
FreeBSD-src-d7f5735176108a79c2472374356b6f9657eb4365.tar.gz
Update ls -l tests to use mtime, not birthtime
PR: 204155 Reviewed by: ngie, rodrigc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4040
Diffstat (limited to 'bin/ls')
-rwxr-xr-xbin/ls/tests/ls_tests.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh
index 39c8569..fbbf24d 100755
--- a/bin/ls/tests/ls_tests.sh
+++ b/bin/ls/tests/ls_tests.sh
@@ -418,10 +418,10 @@ T_flag_body()
atf_check -e empty -o empty -s exit:0 touch a.file
- birthtime_in_secs=$(stat -f %B -t %s a.file)
- birthtime=$(date -j -f %s $birthtime_in_secs +"[[:space:]]+%b[[:space:]]+%e[[:space:]]+%H:%M:%S[[:space:]]+%Y")
+ mtime_in_secs=$(stat -f %m -t %s a.file)
+ mtime=$(date -j -f %s $mtime_in_secs +"[[:space:]]+%b[[:space:]]+%e[[:space:]]+%H:%M:%S[[:space:]]+%Y")
- atf_check -e empty -o match:"$birthtime"'[[:space:]]+a\.file' \
+ atf_check -e empty -o match:"$mtime"'[[:space:]]+a\.file' \
-s exit:0 ls -lT a.file
}
@@ -626,10 +626,10 @@ l_flag_body()
atf_check -e empty -o empty -s exit:0 touch a.file
- birthtime_in_secs=$(stat -f "%B" -t "%s" a.file)
- birthtime=$(date -j -f "%s" $birthtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M")
+ mtime_in_secs=$(stat -f "%m" -t "%s" a.file)
+ mtime=$(date -j -f "%s" $mtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M")
- expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Su[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$birthtime[[:space:]]+a\\.file" a.file)
+ expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Su[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$mtime[[:space:]]+a\\.file" a.file)
atf_check -e empty -o match:"$expected_output" -s exit:0 ls -l a.file
}
OpenPOWER on IntegriCloud