Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 2015 01:21:27 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292581 - head/contrib/netbsd-tests/usr.bin/grep
Message-ID:  <201512220121.tBM1LRuZ081058@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Tue Dec 22 01:21:27 2015
New Revision: 292581
URL: https://svnweb.freebsd.org/changeset/base/292581

Log:
  Use stable output to a test file instead of depending on the OS name being
  grep'able in /bin/sh
  
  This fixes the situation where the OS has been rebranded to something other
  than `FreeBSD`
  
  MFC after: 1 week
  Obtained from: Isilon OneFS (^/onefs/head@r511419)
  Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/usr.bin/grep/d_binary.out
  head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh

Modified: head/contrib/netbsd-tests/usr.bin/grep/d_binary.out
==============================================================================
--- head/contrib/netbsd-tests/usr.bin/grep/d_binary.out	Tue Dec 22 00:58:35 2015	(r292580)
+++ head/contrib/netbsd-tests/usr.bin/grep/d_binary.out	Tue Dec 22 01:21:27 2015	(r292581)
@@ -1 +1 @@
-Binary file /bin/sh matches
+Binary file test.file matches

Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
==============================================================================
--- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Tue Dec 22 00:58:35 2015	(r292580)
+++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Tue Dec 22 01:21:27 2015	(r292581)
@@ -43,7 +43,20 @@ binary_head()
 }
 binary_body()
 {
+	# Begin FreeBSD
+	#
+	# Generate stable output instead of depending on uname to match the
+	# branded OS name of /bin/sh
+	if true; then
+	dd if=/dev/zero count=1 of=test.file
+	echo -n "foobar" >> test.file
+	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
+	else
+	# End FreeBSD
 	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+	# Begin FreeBSD
+	fi
+	# End FreeBSD
 }
 
 atf_test_case recurse



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