summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-29 01:07:00 +0000
committerngie <ngie@FreeBSD.org>2015-12-29 01:07:00 +0000
commit27241dd28beeb2415d518a2877d94c8f4056a0a9 (patch)
tree053e15dde8b57d383cb382b251a62dacce57127e /contrib
parent1afba7abbc9faeab77bb817b6aa853997479ee09 (diff)
downloadFreeBSD-src-27241dd28beeb2415d518a2877d94c8f4056a0a9.zip
FreeBSD-src-27241dd28beeb2415d518a2877d94c8f4056a0a9.tar.gz
MFC r292581:
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` Obtained from: Isilon OneFS (^/onefs/head@r511419) Reviewed by: cem, Daniel O'Connor <darius@dons.net.au> Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib')
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_binary.out2
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/grep/t_grep.sh13
2 files changed, 14 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_binary.out b/contrib/netbsd-tests/usr.bin/grep/d_binary.out
index ce03056..f0ef988 100644
--- a/contrib/netbsd-tests/usr.bin/grep/d_binary.out
+++ b/contrib/netbsd-tests/usr.bin/grep/d_binary.out
@@ -1 +1 @@
-Binary file /bin/sh matches
+Binary file test.file matches
diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
index f2d70f0..7e53016 100755
--- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
+++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
@@ -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
OpenPOWER on IntegriCloud