Add UST overlap tests
[lttng-tools.git] / tests / utils.sh
index 5e32e78f03bd1f39edea9440c9338f28c2b20875..23b2dfd0737c8a3d401939ca66218d06b1f5961b 100644 (file)
@@ -264,10 +264,76 @@ function disable_lttng_channel()
 function enable_ust_lttng_event ()
 {
        sess_name=$1
-       event_name=$2
+       event_name="$2"
 
        echo -n "Enabling lttng event $event_name for session $sess_name "
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u >/dev/null 2>&1
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u >/dev/null 2>&1
+       if [ $? -eq 1 ]; then
+               print_fail
+               return 1
+       else
+               print_ok
+       fi
+}
+
+function enable_ust_lttng_event_filter()
+{
+       sess_name="$1"
+       event_name="$2"
+       filter="$3"
+       echo -n "Enabling lttng event with filtering "
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u --filter "$filter" 2>&1 >/dev/null
+       if [ $? -eq 0 ]; then
+               print_ok
+               return 0
+       else
+               print_fail
+               return 1
+       fi
+}
+
+function enable_ust_lttng_event_loglevel()
+{
+       sess_name="$1"
+       event_name="$2"
+       loglevel="$3"
+       echo -n "Enabling lttng event $event_name with loglevel $loglevel"
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u --loglevel $loglevel 2>&1 >/dev/null
+       if [ $? -eq 0 ]; then
+               print_ok
+               return 0
+       else
+               print_fail
+               return 1
+       fi
+}
+
+function enable_ust_lttng_event_loglevel_only()
+{
+       sess_name="$1"
+       event_name="$2"
+       loglevel="$3"
+       echo -n "Enabling lttng event $event_name with loglevel-only $loglevel"
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u --loglevel-only $loglevel 2>&1 >/dev/null
+       if [ $? -eq 0 ]; then
+               print_ok
+               return 0
+       else
+               print_fail
+               return 1
+       fi
+}
+
+function disable_ust_lttng_event ()
+{
+       sess_name=$1
+       event_name=$2
+
+       echo -n "Disabling lttng event $event_name for session $sess_name "
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event $event_name -s $sess_name -u >/dev/null 2>&1
        if [ $? -eq 1 ]; then
                print_fail
                return 1
This page took 0.050188 seconds and 4 git commands to generate.