Test fix: ignore stderr at every step of randstring
[lttng-tools.git] / tests / utils / utils.sh
index da23f7abeb1780191b86e41a0a88219fd32eeb56..3964e3b12820901957d68f1bf1bbe91497a99b88 100644 (file)
@@ -33,6 +33,12 @@ KERNEL_PATCHLEVEL_VERSION=27
 # systems. Specialized tests should test those corner-cases.
 export LTTNG_UST_REGISTER_TIMEOUT=-1
 
+# We set the default lttng-sessiond path to /bin/true to prevent the spawning
+# of a daemonized sessiond. This is necessary since 'lttng create' will spawn
+# its own sessiond if none is running. It also ensures that 'lttng create'
+# fails when no sessiond is running.
+export LTTNG_SESSIOND_PATH="/bin/true"
+
 source $TESTDIR/utils/tap/tap.sh
 
 function print_ok ()
@@ -82,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 2>/dev/null | tr -cd "$CHAR" 2>/dev/null | head -c ${1:-16} 2>/dev/null
        echo
 }
 
This page took 0.023472 seconds and 4 git commands to generate.