]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
tools/testing/selftests/sysctl/sysctl.sh: ignore diff output on verify_diff_w()
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 14 May 2019 22:45:04 +0000 (15:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 May 2019 02:52:51 +0000 (19:52 -0700)
When verify_diff_w() is used we care about the result, not the verbose
output, and although we use -q, that still gives us a chatty message
about if the files differ or not.  Since verify_diff_w() uses stdinput
the chatty message says whether or not "-" matches the target file, and
this just seems rather odd.  Better to just ignore that messsage all
together, what we really care about i sthe results, the return value and
we check for that.

Link: http://lkml.kernel.org/r/20190320222831.8243-4-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Eric Sandeen <sandeen@redhat.com>
Cc: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/sysctl/sysctl.sh

index e0c8404da6b031f72a3b8c48132acf68c1cb890b..f51987d0d32dff6038735ed9ab3cf708be3eccf0 100755 (executable)
@@ -179,7 +179,7 @@ verify()
 
 verify_diff_w()
 {
-       echo "$TEST_STR" | diff -q -w -u - $1
+       echo "$TEST_STR" | diff -q -w -u - $1 > /dev/null
        return $?
 }