Clean-up: modernize pretty_xml.cpp
[lttng-tools.git] / tests / regression / tools / trigger / test_list_triggers_cli
index e6d025078a3921c20a88609661809819230eba94..b99288471d92b8ee5b446ea63143887ae2c61b75 100755 (executable)
@@ -36,22 +36,12 @@ uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binar
 register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers")
 
 uid=$(id --user)
-gid=$(id --group)
 
-if [ "$uid" == "0" ]; then
-       ist_root=1
-       ls "$uprobe_sdt_binary" >/dev/null 2>&1
-       if test $? == 0; then
-               hast_sdt_binary=1
-       else
-               hast_sdt_binary=0
-       fi
-else
-       ist_root=0
-       hast_sdt_binary=0
+sdt_binary_present=0
+if [ -f "$uprobe_sdt_binary" ]; then
+       sdt_binary_present=1
 fi
 
-
 test_top_level_options ()
 {
        diag "Listing top level options"
@@ -799,8 +789,8 @@ test_event_rule_matches_probe ()
 
        diag "Listing event-rule-matches kernel probe"
 
-       channel_enable_addr=$(grep 'lttng_channel_enable' /proc/kallsyms | cut -f 1 -d ' ')
-       channel_disable_addr=$(grep 'lttng_channel_disable' /proc/kallsyms | cut -f 1 -d ' ')
+       channel_enable_addr=$(grep '\<lttng_channel_enable\>' /proc/kallsyms | cut -f 1 -d ' ')
+       channel_disable_addr=$(grep '\<lttng_channel_disable\>' /proc/kallsyms | cut -f 1 -d ' ')
 
        # We need to find a valid offset.
        base_symbol=""
@@ -1606,7 +1596,7 @@ test_buffer_usage_conditions ()
          condition: buffer usage high
            session name: the-session-name
            channel name: the-channel-name
-           domain: ust
+           domain: user space
            threshold (bytes): 1234
            errors: none
          actions:
@@ -1618,7 +1608,7 @@ test_buffer_usage_conditions ()
          condition: buffer usage high
            session name: the-session-name
            channel name: the-channel-name
-           domain: ust
+           domain: user space
            threshold (ratio): 0.25
            errors: none
          actions:
@@ -1630,7 +1620,7 @@ test_buffer_usage_conditions ()
          condition: buffer usage low
            session name: the-session-name
            channel name: the-channel-name
-           domain: ust
+           domain: user space
            threshold (bytes): 2345
            errors: none
          actions:
@@ -1642,7 +1632,7 @@ test_buffer_usage_conditions ()
          condition: buffer usage low
            session name: the-session-name
            channel name: the-channel-name
-           domain: ust
+           domain: user space
            threshold (ratio): 0.40
            errors: none
          actions:
@@ -2695,10 +2685,12 @@ start_lttng_sessiond_notap
 
 test_top_level_options
 test_event_rule_matches_tracepoint
-skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe
-skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf
-skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
-skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall
+check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || {
+       test_event_rule_matches_probe
+       test_event_rule_matches_userspace_probe_elf
+       skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
+       test_event_rule_matches_syscall
+}
 test_session_consumed_size_condition
 test_buffer_usage_conditions
 test_session_rotation_conditions
This page took 0.024935 seconds and 4 git commands to generate.