CLI: make list-triggers command print capture expressions
[lttng-tools.git] / tests / regression / tools / trigger / test_list_triggers_cli
index e09d7cdc6894763dc50697abd2b0f716e268d5a2..1257ec881cca6ea047ba6ebee10f4ffb6aa2e5b1 100755 (executable)
@@ -23,7 +23,7 @@ TESTDIR="$CURDIR/../../.."
 # shellcheck source=../../../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
-plan_tests 40
+plan_tests 44
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
@@ -110,6 +110,11 @@ test_on_event_tracepoint ()
        add_trigger --condition on-event 'hello*' -u -x 'hello2,hello3,hello4' --action notify
        add_trigger --id BCD --condition on-event -u gerboise --loglevel INFO --action notify
        add_trigger --condition on-event -u lemming --loglevel-only WARNING --action notify
+       add_trigger --condition on-event -u capture-payload-field --capture a --action notify
+       add_trigger --condition on-event -u capture-array --capture 'a[2]' --capture '$ctx.tourlou[18]' --action notify
+       add_trigger --condition on-event -u capture-chan-ctx --capture '$ctx.vpid' --action notify
+       add_trigger --condition on-event -u capture-app-ctx --capture '$app.iga:active_clients' --action notify
+
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - id: ABC
@@ -142,6 +147,39 @@ test_on_event_tracepoint ()
            rule: lemming (type: tracepoint, domain: ust, log level == TRACE_WARNING)
          actions:
            notify
+       - id: T3
+         user id: ${uid}
+         condition: event rule hit
+           rule: capture-payload-field (type: tracepoint, domain: ust)
+           captures:
+             - a
+         actions:
+           notify
+       - id: T4
+         user id: ${uid}
+         condition: event rule hit
+           rule: capture-array (type: tracepoint, domain: ust)
+           captures:
+             - a[2]
+             - \$ctx.tourlou[18]
+         actions:
+           notify
+       - id: T5
+         user id: ${uid}
+         condition: event rule hit
+           rule: capture-chan-ctx (type: tracepoint, domain: ust)
+           captures:
+             - \$ctx.vpid
+         actions:
+           notify
+       - id: T6
+         user id: ${uid}
+         condition: event rule hit
+           rule: capture-app-ctx (type: tracepoint, domain: ust)
+           captures:
+             - \$app.iga:active_clients
+         actions:
+           notify
        EOF
 
        list_triggers "on-event, tracepoint event rule" "${tmp_expected_stdout}"
This page took 0.031664 seconds and 4 git commands to generate.