Test fix: ignore stderr when generating random string
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Mar 2016 20:26:37 +0000 (15:26 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Mar 2016 20:28:07 +0000 (15:28 -0500)
tr often reports a broken pipe when the head command exits
(after having received enough characters) which pollutes the
test output.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/utils.sh

index 4ee3dda8720428c9ab36c65ba9065d0bd25b8d66..56fe622e9c8a842f9b6a53748be7f9397b370a58 100644 (file)
@@ -88,7 +88,7 @@ function validate_kernel_version ()
 function randstring()
 {
        [ "$2" == "0" ] && CHAR="[:alnum:]" || CHAR="[:graph:]"
-       cat /dev/urandom | tr -cd "$CHAR" | head -c ${1:-16}
+       cat /dev/urandom | tr -cd "$CHAR" | head -c ${1:-16} 2>/dev/null
        echo
 }
 
This page took 0.026689 seconds and 4 git commands to generate.