X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftrigger%2Ftest_list_triggers_cli;fp=tests%2Fregression%2Ftools%2Ftrigger%2Ftest_list_triggers_cli;h=d033295479ab15978b3084701d8dca15fb0824be;hb=dceffc9efc9bff19cef221d6620e42f30ee361d5;hp=dcc6344385f15d394f2c4187f5a506bc39756e1e;hpb=252bb1282a12df7ee188d4dc4976e239c755e837;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 dcc634438..d03329547 100755 --- a/tests/regression/tools/trigger/test_list_triggers_cli +++ b/tests/regression/tools/trigger/test_list_triggers_cli @@ -23,13 +23,14 @@ TESTDIR="$CURDIR/../../.." # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" -NUM_TESTS=106 +NUM_TESTS=150 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" tmp_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_stdout.XXXXXX) tmp_stderr=$(mktemp --tmpdir -t test_list_triggers_cli_stderr.XXXXXX) tmp_expected_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.XXXXXX) +tmp_expected_stdout_mi=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.mi.XXXXXX) uprobe_elf_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary") uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binary/.libs/userspace-probe-sdt-binary") register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers") @@ -69,7 +70,65 @@ test_top_level_options () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + hello + ${uid} + + + + + test-name + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "top level options" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI top level options" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "hello" } @@ -191,7 +250,535 @@ test_event_rule_matches_tracepoint () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + A + ${uid} + + + + + aaa + p == 2 + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + B + ${uid} + + + + + gerboise + + + 6 + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + C + ${uid} + + + + + * + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + D + ${uid} + + + + + hello* + + hello2 + hello3 + hello4 + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + E + ${uid} + + + + + lemming + + + 4 + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + F + ${uid} + + + + + capture-payload-field + + + + + + a + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + G + ${uid} + + + + + capture-array + + + + + + 2 + + + a + + + + + + + 18 + + + tourlou + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + H + ${uid} + + + + + capture-chan-ctx + + + + + + vpid + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + I + ${uid} + + + + + capture-app-ctx + + + + + + iga + active_clients + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + J + ${uid} + + + + + lemming + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "event-rule-matches, tracepoint event rule" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI event-rule-matches, tracepoint event rule" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "A" lttng_remove_trigger_ok "B" @@ -227,6 +814,7 @@ test_event_rule_matches_probe () fi offset_hex="0x$(printf '%x' $offset)" + channel_enable_addr_decimal=$(echo "ibase=16; ${channel_enable_addr^^} " | bc) lttng_add_trigger_ok "T0" --condition event-rule-matches --type=kprobe --location=lttng_channel_enable --event-name=my_channel_enable --action notify lttng_add_trigger_ok "T1" --condition event-rule-matches --type=kprobe --location="${base_symbol}+${offset_hex}" --event-name=my_channel_enable --action notify @@ -262,7 +850,174 @@ test_event_rule_matches_probe () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + my_channel_enable + + + lttng_channel_enable + 0 + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T1 + ${uid} + + + + + my_channel_enable + + + ${base_symbol} + ${offset} + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T2 + ${uid} + + + + + my_channel_enable + + +
${channel_enable_addr_decimal}
+
+
+
+
+ +
+ + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + +
+ + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + +
+
+
+
+ EOF + list_triggers_matches_ok "event-rule-matches, probe event rule" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI event-rule-matches, probe event rule" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" lttng_remove_trigger_ok "T1" @@ -289,7 +1044,75 @@ test_event_rule_matches_userspace_probe_elf () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + ma-probe-elf + + + ${elf_function_name} + ${uprobe_elf_binary} + ENTRY + + + + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "event-rule-matches, userspace-probe event rule" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI event-rule-matches, userspace-probe event rule" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" } @@ -315,7 +1138,75 @@ test_event_rule_matches_userspace_probe_sdt () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + ma-probe-sdt + + + ${sdt_probe_name} + ${sdt_provider_name} + ${uprobe_sdt_binary} + + + + + + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "event-rule-matches, userspace-probe event rule SDT" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI event-rule-matches, userspace-probe event rule SDT" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" } @@ -378,7 +1269,256 @@ test_event_rule_matches_syscall () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + entry+exit + open + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T1 + ${uid} + + + + + entry + open + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T2 + ${uid} + + + + + exit + open + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T3 + ${uid} + + + + + entry+exit + open + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T4 + ${uid} + + + + + entry+exit + ptrace + a > 2 + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + + list_triggers_matches_ok "event-rule-matches, syscall event rule" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI event-rule-matches, syscall event rule" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" lttng_remove_trigger_ok "T1" @@ -404,7 +1544,54 @@ test_session_consumed_size_condition () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + trigger-with-session-consumed-size-condition + ${uid} + + + the-session-name + 1234 + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + + list_triggers_matches_ok "session consumed size condition" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI session consumed size condition" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "trigger-with-session-consumed-size-condition" } @@ -464,7 +1651,163 @@ test_buffer_usage_conditions () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + trigger-with-buffer-usage-high-bytes-condition + ${uid} + + + the-session-name + the-channel-name + UST + 1234 + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + trigger-with-buffer-usage-high-ratio-condition + ${uid} + + + the-session-name + the-channel-name + UST + 0.250000 + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + trigger-with-buffer-usage-low-bytes-condition + ${uid} + + + the-session-name + the-channel-name + UST + 2345 + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + trigger-with-buffer-usage-low-ratio-condition + ${uid} + + + the-session-name + the-channel-name + UST + 0.400000 + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "buffer usage condition" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI buffer usage condition" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "trigger-with-buffer-usage-high-bytes-condition" lttng_remove_trigger_ok "trigger-with-buffer-usage-high-ratio-condition" @@ -497,7 +1840,85 @@ test_session_rotation_conditions () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + trigger-with-session-rotation-completed-condition + ${uid} + + + the-session-name + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + trigger-with-session-rotation-ongoing-condition + ${uid} + + + the-session-name + + + + + + + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "session rotation conditions" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI session rotation conditions" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "trigger-with-session-rotation-completed-condition" lttng_remove_trigger_ok "trigger-with-session-rotation-ongoing-condition" @@ -611,7 +2032,513 @@ test_snapshot_action () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T1 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + /some/path + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T2 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + /some/other/path + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T3 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + net://1.2.3.4 + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T4 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + net://1.2.3.4:1234:1235 + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T5 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + tcp://1.2.3.4:1111 + tcp://1.2.3.4:1112 + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T6 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + /some/path + 1234 + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T7 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + meh + /some/path + + + + 1 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T8 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + + 10 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T9 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + ze-session + + + 10 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "snapshot action" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI snapshot action" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" lttng_remove_trigger_ok "T1" @@ -651,7 +2578,111 @@ test_notify_action () errors: none EOF + cat > "${tmp_expected_stdout_mi}" <<- EOF + + + list-trigger + + + + T0 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 5 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + T1 + ${uid} + + + + + some-event + + + + + + + discarded tracer messages + Count of messages discarded by the tracer due to a communication error with the session daemon + + 0 + + + + + + + + + + + 10 + + + + + + total execution failures + Aggregated count of errors encountered when executing the action + + 0 + + + + + + + + + + + + EOF + list_triggers_matches_ok "notify action" "${tmp_expected_stdout}" + list_triggers_matches_mi_ok "MI notify action" "${tmp_expected_stdout_mi}" lttng_remove_trigger_ok "T0" lttng_remove_trigger_ok "T1" @@ -664,10 +2695,10 @@ start_lttng_sessiond_notap test_top_level_options 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 +skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe +skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf +skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt +skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall test_session_consumed_size_condition test_buffer_usage_conditions test_session_rotation_conditions