X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftrigger%2Ftest_list_triggers_cli;h=7abae223c26aebd87b929906c2733bbdfebe19d8;hb=b03a81fbbc65c1cf2e9abc67c56465137c788322;hp=89c77eb54d41b20c1405441c96229a9b16dad21c;hpb=19904669a9eb25cd4a0ccd3de82d3ac803dfe877;p=lttng-tools.git diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli index 89c77eb54..7abae223c 100755 --- a/tests/regression/tools/trigger/test_list_triggers_cli +++ b/tests/regression/tools/trigger/test_list_triggers_cli @@ -23,7 +23,7 @@ TESTDIR="$CURDIR/../../.." # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" -NUM_TESTS=100 +NUM_TESTS=106 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" @@ -88,13 +88,13 @@ test_top_level_options () lttng_remove_trigger_ok "hello" } -test_on_event_tracepoint () +test_event_rule_matches_tracepoint () { diag "Listing on-event tracepoint" lttng_add_trigger_ok "C" --condition event-rule-matches --domain=user --action notify lttng_add_trigger_ok "A" --condition event-rule-matches --name=aaa --domain=user --filter 'p == 2' --action notify - lttng_add_trigger_ok "D" --condition event-rule-matches --name='hello*' --domain=user -x 'hello2,hello3,hello4' --action notify + lttng_add_trigger_ok "D" --condition event-rule-matches --name='hello*' --domain=user -x hello2 --exclude-name hello3 -x hello4 --action notify lttng_add_trigger_ok "B" --condition event-rule-matches --domain=user --name=gerboise --log-level INFO.. --action notify lttng_add_trigger_ok "E" --condition event-rule-matches --domain=user --name=lemming --log-level WARNING --action notify lttng_add_trigger_ok "J" --condition event-rule-matches --domain=user --name=lemming --log-level .. --action notify @@ -209,7 +209,7 @@ test_on_event_tracepoint () lttng_remove_trigger_ok "J" } -test_on_event_probe () +test_event_rule_matches_probe () { local channel_enable_addr local channel_disable_addr @@ -270,7 +270,7 @@ test_on_event_probe () lttng_remove_trigger_ok "T2" } -test_on_event_userspace_probe_elf () +test_event_rule_matches_userspace_probe_elf () { local elf_function_name="test_function" @@ -294,7 +294,7 @@ test_on_event_userspace_probe_elf () lttng_remove_trigger_ok "T0" } -test_on_event_userspace_probe_sdt () +test_event_rule_matches_userspace_probe_sdt () { local sdt_provider_name="foobar" local sdt_probe_name="tp1" @@ -319,18 +319,21 @@ test_on_event_userspace_probe_sdt () lttng_remove_trigger_ok "T0" } -test_on_event_syscall () +test_event_rule_matches_syscall () { diag "Listing on-event syscall" lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=syscall --name=open --action notify - lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --type=syscall --name=ptrace --filter 'a > 2' --action notify + lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --type=syscall:entry --name=open --action notify + lttng_add_trigger_ok "T2" --condition event-rule-matches --domain=kernel --type=syscall:exit --name=open --action notify + lttng_add_trigger_ok "T3" --condition event-rule-matches --domain=kernel --type=syscall:entry+exit --name=open --action notify + lttng_add_trigger_ok "T4" --condition event-rule-matches --domain=kernel --type=syscall --name=ptrace --filter 'a > 2' --action notify cat > "${tmp_expected_stdout}" <<- EOF - name: T0 owner uid: ${uid} condition: event rule hit - rule: open (type: syscall) + rule: open (type: syscall:entry+exit) actions: notify errors: none @@ -338,7 +341,31 @@ test_on_event_syscall () - name: T1 owner uid: ${uid} condition: event rule hit - rule: ptrace (type: syscall, filter: a > 2) + rule: open (type: syscall:entry) + actions: + notify + errors: none + errors: none + - name: T2 + owner uid: ${uid} + condition: event rule hit + rule: open (type: syscall:exit) + actions: + notify + errors: none + errors: none + - name: T3 + owner uid: ${uid} + condition: event rule hit + rule: open (type: syscall:entry+exit) + actions: + notify + errors: none + errors: none + - name: T4 + owner uid: ${uid} + condition: event rule hit + rule: ptrace (type: syscall:entry+exit, filter: a > 2) actions: notify errors: none @@ -349,6 +376,9 @@ test_on_event_syscall () lttng_remove_trigger_ok "T0" lttng_remove_trigger_ok "T1" + lttng_remove_trigger_ok "T2" + lttng_remove_trigger_ok "T3" + lttng_remove_trigger_ok "T4" } test_session_consumed_size_condition () @@ -608,11 +638,11 @@ plan_tests $NUM_TESTS start_lttng_sessiond_notap test_top_level_options -test_on_event_tracepoint -skip $ist_root "non-root user: skipping kprobe tests" 9 || test_on_event_probe -skip $ist_root "non-root user: skipping uprobe tests" 5 || test_on_event_userspace_probe_elf -skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 5 || test_on_event_userspace_probe_sdt -skip $ist_root "non-root user: skipping syscall tests" 7 || test_on_event_syscall +test_event_rule_matches_tracepoint +skip $ist_root "non-root user: skipping kprobe tests" 9 || test_event_rule_matches_probe +skip $ist_root "non-root user: skipping uprobe tests" 5 || test_event_rule_matches_userspace_probe_elf +skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 5 || test_event_rule_matches_userspace_probe_sdt +skip $ist_root "non-root user: skipping syscall tests" 13 || test_event_rule_matches_syscall test_session_consumed_size_condition test_buffer_usage_conditions test_session_rotation_conditions