Rename lttng_event_rule_kernel_probe to lttng_event_rule_kernel_kprobe
[lttng-tools.git] / tests / regression / tools / trigger / test_add_trigger_cli
index cf45b4e9679d55fe5a44b6940a677c46fe42f413..01859ee74f7ac520fccd641389e7a1e55797e57d 100755 (executable)
@@ -23,15 +23,15 @@ TESTDIR="$CURDIR/../../.."
 # shellcheck source=../../../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
-plan_tests 285
+plan_tests 288
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
 # shellcheck disable=SC2119
 start_lttng_sessiond_notap
 
-tmp_stdout=$(mktemp -t test_parse_cli_trigger_stdout.XXXXXX)
-tmp_stderr=$(mktemp -t test_parse_cli_trigger_stderr.XXXXXX)
+tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX)
+tmp_stderr=$(mktemp --tmpdir -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
@@ -147,7 +147,7 @@ test_success "--exclude-name two" \
        --action notify
 
 skip $ist_root "non-root user: skipping kprobe tests" 18 || {
-       for type in kprobe kernel-probe; do
+       for type in kprobe kernel:kprobe; do
                test_success "--condition event-rule-matches probe by symbol" \
                        --condition event-rule-matches --domain=kernel --type=$type --location=lttng_channel_enable --event-name=my_channel_enable \
                        --action notify
@@ -178,19 +178,17 @@ skip $ist_root "non-root user: skipping kprobe tests" 18 || {
        done
 }
 
-skip $ist_root "non-root user: skipping uprobe tests" 12 || {
-       for type in uprobe userspace-probe; do
-               test_success "--condition event-rule-matches uprobe" \
-                       --condition event-rule-matches --domain=kernel --type=$type --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \
-                       --action notify
+skip $ist_root "non-root user: skipping uprobe tests" 6 || {
+       test_success "--condition event-rule-matches uprobe" \
+               --condition event-rule-matches --domain=kernel --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \
+               --action notify
 
-               test_success "--condition event-rule-matches uprobe with elf prefix" \
-                       --condition event-rule-matches --domain=kernel --type=$type --location=elf:${uprobe_elf_binary}:test_function --event-name=ma-probe-2 \
-                       --action notify
-       done
+       test_success "--condition event-rule-matches uprobe with elf prefix" \
+               --condition event-rule-matches --domain=kernel --type=kernel:uprobe --location=elf:${uprobe_elf_binary}:test_function --event-name=ma-probe-2 \
+               --action notify
 }
 
-skip $ist_root "non-root user: skipping syscall tests" 18 || {
+skip $ist_root "non-root user: skipping syscall tests" 30 || {
        test_success "--condition event-rule-matches one syscall" \
                --condition event-rule-matches --domain=kernel --type=syscall --name=open \
                --action notify
@@ -211,6 +209,22 @@ skip $ist_root "non-root user: skipping syscall tests" 18 || {
        test_success "--condition event-rule-matches one syscall:entry-exit" \
                --condition event-rule-matches --domain=kernel --type=syscall:entry+exit --name=open \
                --action notify
+
+       # Same thing but with "kernel:syscall" type instead:
+       test_success "--condition event-rule-matches one syscall" \
+               --condition event-rule-matches --domain=kernel --type=kernel:syscall --name=open \
+               --action notify
+
+       test_success "--condition event-rule-matches one kernel:syscall:entry" \
+               --condition event-rule-matches --domain=kernel --type=kernel:syscall:entry --name=open \
+               --action notify
+       test_success "--condition event-rule-matches one kernel:syscall:exit" \
+               --condition event-rule-matches --domain=kernel --type=kernel:syscall:exit --name=open \
+               --action notify
+       test_success "--condition event-rule-matches one kernel:syscall:entry-exit" \
+               --condition event-rule-matches --domain=kernel --type=kernel:syscall:entry+exit --name=open \
+               --action notify
+
 }
 
 # `--action notify` successes
@@ -350,9 +364,9 @@ test_failure "two different --domain" \
        "Error: More than one \`--domain\` was specified." \
        --condition event-rule-matches --domain=user --domain=kernel
 
-for type in kprobe kernel-probe; do
+for type in kprobe kernel:kprobe; do
        test_failure "--condition event-rule-matches: --name with --type=$type" \
-               "Error: Can't use --name with probe event rules." \
+               "Error: Can't use --name with kernel kprobe event rules." \
                --condition event-rule-matches --type=$type --location=do_sys_open --name='hello'
 done
 
@@ -364,11 +378,9 @@ test_failure "--condition event-rule-matches: --event-name with tracepoint event
        "Error: Can't use --event-name with tracepoint event rules." \
        --condition event-rule-matches --domain=user --event-name='hello'
 
-for type in uprobe userspace-probe; do
-       test_failure "--condition event-rule-matches: extra argument with --type=$type" \
-               "Error: Unexpected argument 'hello'" \
-               --condition event-rule-matches --domain=kernel --type=$type --location=${uprobe_elf_binary}:test_failure hello
-done
+test_failure "--condition event-rule-matches: extra argument with --type=kernel:uprobe" \
+       "Error: Unexpected argument 'hello'" \
+       --condition event-rule-matches --domain=kernel --type=$type --location=${uprobe_elf_binary}:test_failure hello
 
 test_failure "--condition event-rule-matches: extra argument with --type=syscall" \
        "Error: Unexpected argument 'open'" \
This page took 0.025101 seconds and 5 git commands to generate.