X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftrigger%2Ftest_add_trigger_cli;h=029f17cef6d139722a319b909aba8fdb0d4824bc;hb=4f7da553ae57a6c947da2b9668c06418b2d50e99;hp=de50c9f0fe25ed5277c71e4ee4e8018d0b865a61;hpb=57739a6b3247c7ded74522906e214eff0d6dc14c;p=lttng-tools.git diff --git a/tests/regression/tools/trigger/test_add_trigger_cli b/tests/regression/tools/trigger/test_add_trigger_cli index de50c9f0f..029f17cef 100755 --- a/tests/regression/tools/trigger/test_add_trigger_cli +++ b/tests/regression/tools/trigger/test_add_trigger_cli @@ -23,15 +23,15 @@ TESTDIR="$CURDIR/../../.." # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" -plan_tests 276 +plan_tests 297 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 @@ -138,6 +138,14 @@ test_success "--log-level range any" \ --condition event-rule-matches --domain=user --log-level=.. \ --action notify +test_success "--exclude-name one" \ + --condition event-rule-matches --domain=user --name='bernard*' --exclude-name=bernard-lermite \ + --action notify + +test_success "--exclude-name two" \ + --condition event-rule-matches --domain=user --name='jean-*' --exclude-name jean-chretien -x jean-charest \ + --action notify + skip $ist_root "non-root user: skipping kprobe tests" 18 || { for type in kprobe kernel-probe; do test_success "--condition event-rule-matches probe by symbol" \ @@ -182,7 +190,7 @@ skip $ist_root "non-root user: skipping uprobe tests" 12 || { done } -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 @@ -203,6 +211,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 @@ -371,6 +395,11 @@ test_failure "--condition event-rule-matches: --type=syscall:nope" \ --condition event-rule-matches --domain=kernel --type=syscall:nope \ --name=open +test_failure "--exclude-name with non-glob name" \ + "Error: Event jean: Exclusions can only be used with a globbing pattern" \ + --condition event-rule-matches --domain=user --name='jean' --exclude-name jean-chretien \ + --action notify + test_failure "--condition event-rule-matches --capture: missing argument (end of arg list)" \ 'Error: While parsing argument #2 (`--capture`): Missing required argument for option `--capture`' \ --action notify \