Test: prevent the spawning of a daemonized sessiond
[lttng-tools.git] / tests / utils / utils.sh
index 42b344138d9f176ef2fcb39e37fbec9acc2e994b..4ee3dda8720428c9ab36c65ba9065d0bd25b8d66 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 ()
@@ -86,6 +92,16 @@ function randstring()
        echo
 }
 
+# Return the number of _configured_ CPUs.
+function conf_proc_count()
+{
+       getconf _NPROCESSORS_CONF
+       if [ $? -ne 0 ]; then
+               diag "Failed to get the number of configured CPUs"
+       fi
+       echo
+}
+
 function enable_kernel_lttng_event
 {
        local expected_to_fail="$1"
This page took 0.023032 seconds and 4 git commands to generate.