tests: add check_skip_kernel_test to check root user and lttng kernel modules
[lttng-tools.git] / tests / regression / tools / trigger / test_add_trigger_cli
index 8566b36078ad17fde84e637a10bfa528e24f5816..eeef3e250b86dc62c362da05fa4f7a9cd27232f5 100755 (executable)
@@ -34,12 +34,6 @@ tmp_stdout=$(mktemp -t test_parse_cli_trigger_stdout.XXXXXX)
 tmp_stderr=$(mktemp -t test_parse_cli_trigger_stderr.XXXXXX)
 uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary"
 
-if [ "$(id -u)" == "0" ]; then
-       ist_root=1
-else
-       ist_root=0
-fi
-
 function test_success ()
 {
        local test_name="$1"
@@ -223,7 +217,7 @@ test_success "--exclude-name two" "trigger5" \
        --condition event-rule-matches --type=user --name='jean-*' --exclude-name jean-chretien -x jean-charest \
        --action notify
 
-skip $ist_root "non-root user: skipping kprobe tests" 18 || {
+check_skip_kernel_test 18 "Skipping kprobe tests." || {
        i=0
 
        for type in kprobe kernel:kprobe; do
@@ -262,7 +256,7 @@ skip $ist_root "non-root user: skipping kprobe tests" 18 || {
        done
 }
 
-skip $ist_root "non-root user: skipping uprobe tests" 6 || {
+check_skip_kernel_test 6 "Skipping uprobe tests." || {
        test_success "--condition event-rule-matches uprobe" "uprobe-trigger-0" \
                --name="uprobe-trigger-0" \
                --condition event-rule-matches --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \
@@ -274,7 +268,7 @@ skip $ist_root "non-root user: skipping uprobe tests" 6 || {
                --action notify
 }
 
-skip $ist_root "non-root user: skipping syscall tests" 30 || {
+check_skip_kernel_test 30 "Skipping syscall tests." || {
        test_success "--condition event-rule-matches one syscall" "syscall-trigger-0" \
                --name="syscall-trigger-0" \
                --condition event-rule-matches --type=syscall --name=open \
This page took 0.023625 seconds and 4 git commands to generate.