Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Oct 2015 20:14:32 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r290205 - head/bin/ls/tests
Message-ID:  <201510302014.t9UKEWNq049599@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Oct 30 20:14:32 2015
New Revision: 290205
URL: https://svnweb.freebsd.org/changeset/base/290205

Log:
  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

Modified:
  head/bin/ls/tests/ls_tests.sh

Modified: head/bin/ls/tests/ls_tests.sh
==============================================================================
--- head/bin/ls/tests/ls_tests.sh	Fri Oct 30 19:32:30 2015	(r290204)
+++ head/bin/ls/tests/ls_tests.sh	Fri Oct 30 20:14:32 2015	(r290205)
@@ -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
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510302014.t9UKEWNq049599>