lttng add-trigger: replace --exclude-names with --exclude-name
[lttng-tools.git] / tests / regression / tools / trigger / test_add_trigger_cli
index 06bd2d3deecafd5c0577a552251e74980d5b677c..cf45b4e9679d55fe5a44b6940a677c46fe42f413 100755 (executable)
@@ -23,7 +23,7 @@ TESTDIR="$CURDIR/../../.."
 # shellcheck source=../../../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
-plan_tests 264
+plan_tests 285
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
@@ -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" 9 || {
+skip $ist_root "non-root user: skipping syscall tests" 18 || {
        test_success "--condition event-rule-matches one syscall" \
                --condition event-rule-matches --domain=kernel --type=syscall --name=open \
                --action notify
@@ -194,6 +202,15 @@ skip $ist_root "non-root user: skipping syscall tests" 9 || {
        test_success "--condition event-rule-matches one syscall with filter" \
                --condition event-rule-matches --domain=kernel --type=syscall --filter 'a > 2' --name=open \
                --action notify
+       test_success "--condition event-rule-matches one syscall:entry" \
+               --condition event-rule-matches --domain=kernel --type=syscall:entry --name=open \
+               --action notify
+       test_success "--condition event-rule-matches one syscall:exit" \
+               --condition event-rule-matches --domain=kernel --type=syscall:exit --name=open \
+               --action notify
+       test_success "--condition event-rule-matches one syscall:entry-exit" \
+               --condition event-rule-matches --domain=kernel --type=syscall:entry+exit --name=open \
+               --action notify
 }
 
 # `--action notify` successes
@@ -357,6 +374,16 @@ test_failure "--condition event-rule-matches: extra argument with --type=syscall
        "Error: Unexpected argument 'open'" \
        --condition event-rule-matches --domain=kernel --type=syscall open
 
+test_failure "--condition event-rule-matches: --type=syscall:nope" \
+       "Error: Failed to parse syscall 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 \
This page took 0.024048 seconds and 4 git commands to generate.