diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-22 01:21:27 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-22 01:21:27 +0000 |
commit | c2e0ba4db8177981274e2d213b6de70c77b95e4a (patch) | |
tree | d8e60436c8f3413269a509c1a2be3f2201ed60f4 /contrib/netbsd-tests | |
parent | 1a48bc79245f36b15fbb3aa8836ccf8037ba0aa1 (diff) | |
download | FreeBSD-src-c2e0ba4db8177981274e2d213b6de70c77b95e4a.zip FreeBSD-src-c2e0ba4db8177981274e2d213b6de70c77b95e4a.tar.gz |
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
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r-- | contrib/netbsd-tests/usr.bin/grep/d_binary.out | 2 | ||||
-rwxr-xr-x | contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 13 |
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 |