action-executor: consider action firing policy on action execution
[lttng-tools.git] / tests / regression / tools / trigger / test_list_triggers_cli
index fb7ce2c49370abe6322cc05c72eefe3ed40cefcf..a11f8eca9de028ed43b93b48826fae3cdca875b5 100755 (executable)
@@ -41,12 +41,6 @@ else
        ist_root=0
 fi
 
-function add_trigger ()
-{
-       "${FULL_LTTNG_BIN}" add-trigger "$@"
-       ok $? "add trigger \`$*\`: exit code is 0"
-}
-
 function list_triggers ()
 {
        local test_name="$1"
@@ -68,9 +62,9 @@ test_top_level_options ()
        start_lttng_sessiond_notap
 
 
-       add_trigger --id hello --condition on-event -u test-id --action notify
-       add_trigger --fire-once-after 123 --condition on-event -u test-fire-once-after --action notify
-       add_trigger --fire-every 124 --condition on-event -u test-fire-every --action notify
+       lttng_add_trigger_ok "hello" --condition on-event -u test-id --action notify
+       lttng_add_trigger_ok "T0" --fire-once-after 123 --condition on-event -u test-fire-once-after --action notify
+       lttng_add_trigger_ok "T1" --fire-every 124 --condition on-event -u test-fire-every --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - id: T0
@@ -78,6 +72,7 @@ test_top_level_options ()
          firing policy: once after 123 occurences
          condition: event rule hit
            rule: test-fire-once-after (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            notify
        - id: T1
@@ -85,12 +80,14 @@ test_top_level_options ()
          firing policy: after every 124 occurences
          condition: event rule hit
            rule: test-fire-every (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            notify
        - id: hello
          user id: ${uid}
          condition: event rule hit
            rule: test-id (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            notify
        EOF
@@ -105,77 +102,86 @@ test_on_event_tracepoint ()
        # shellcheck disable=SC2119
        start_lttng_sessiond_notap
 
-       add_trigger --condition on-event -u -a --action notify
-       add_trigger --id ABC --condition on-event aaa -u --filter 'p == 2' --action notify
-       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
+       lttng_add_trigger_ok "C" --condition on-event -u -a --action notify
+       lttng_add_trigger_ok "A" --condition on-event aaa -u --filter 'p == 2' --action notify
+       lttng_add_trigger_ok "D" --condition on-event 'hello*' -u -x 'hello2,hello3,hello4' --action notify
+       lttng_add_trigger_ok "B" --condition on-event -u gerboise --loglevel INFO --action notify
+       lttng_add_trigger_ok "E" --condition on-event -u lemming --loglevel-only WARNING --action notify
+       lttng_add_trigger_ok "F" --condition on-event -u capture-payload-field --capture a --action notify
+       lttng_add_trigger_ok "G" --condition on-event -u capture-array --capture 'a[2]' --capture '$ctx.tourlou[18]' --action notify
+       lttng_add_trigger_ok "H" --condition on-event -u capture-chan-ctx --capture '$ctx.vpid' --action notify
+       lttng_add_trigger_ok "I" --condition on-event -u capture-app-ctx --capture '$app.iga:active_clients' --action notify
 
 
        cat > "${tmp_expected_stdout}" <<- EOF
-       - id: ABC
+       - id: A
          user id: ${uid}
          condition: event rule hit
            rule: aaa (type: tracepoint, domain: ust, filter: p == 2)
+           tracer notifications discarded: 0
          actions:
            notify
-       - id: BCD
+       - id: B
          user id: ${uid}
          condition: event rule hit
            rule: gerboise (type: tracepoint, domain: ust, log level at least INFO)
+           tracer notifications discarded: 0
          actions:
            notify
-       - id: T0
+       - id: C
          user id: ${uid}
          condition: event rule hit
            rule: * (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            notify
-       - id: T1
+       - id: D
          user id: ${uid}
          condition: event rule hit
            rule: hello* (type: tracepoint, domain: ust, exclusions: hello2,hello3,hello4)
+           tracer notifications discarded: 0
          actions:
            notify
-       - id: T2
+       - id: E
          user id: ${uid}
          condition: event rule hit
            rule: lemming (type: tracepoint, domain: ust, log level is WARNING)
+           tracer notifications discarded: 0
          actions:
            notify
-       - id: T3
+       - id: F
          user id: ${uid}
          condition: event rule hit
            rule: capture-payload-field (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
            captures:
              - a
          actions:
            notify
-       - id: T4
+       - id: G
          user id: ${uid}
          condition: event rule hit
            rule: capture-array (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
            captures:
              - a[2]
              - \$ctx.tourlou[18]
          actions:
            notify
-       - id: T5
+       - id: H
          user id: ${uid}
          condition: event rule hit
            rule: capture-chan-ctx (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
            captures:
              - \$ctx.vpid
          actions:
            notify
-       - id: T6
+       - id: I
          user id: ${uid}
          condition: event rule hit
            rule: capture-app-ctx (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
            captures:
              - \$app.iga:active_clients
          actions:
@@ -211,27 +217,30 @@ test_on_event_probe ()
 
        offset_hex="0x$(printf '%x' $offset)"
 
-       add_trigger --condition on-event -k --probe=lttng_channel_enable my_channel_enable --action notify
-       add_trigger --condition on-event -k --probe="${base_symbol}+${offset_hex}" my_channel_enable --action notify
-       add_trigger --condition on-event -k --probe="0x${channel_enable_addr}" my_channel_enable --action notify
+       lttng_add_trigger_ok "T0" --condition on-event -k --probe=lttng_channel_enable my_channel_enable --action notify
+       lttng_add_trigger_ok "T1" --condition on-event -k --probe="${base_symbol}+${offset_hex}" my_channel_enable --action notify
+       lttng_add_trigger_ok "T2" --condition on-event -k --probe="0x${channel_enable_addr}" my_channel_enable --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - id: T0
          user id: ${uid}
          condition: event rule hit
            rule: my_channel_enable (type: probe, location: lttng_channel_enable)
+           tracer notifications discarded: 0
          actions:
            notify
        - id: T1
          user id: ${uid}
          condition: event rule hit
            rule: my_channel_enable (type: probe, location: ${base_symbol}+${offset_hex})
+           tracer notifications discarded: 0
          actions:
            notify
        - id: T2
          user id: ${uid}
          condition: event rule hit
            rule: my_channel_enable (type: probe, location: 0x${channel_enable_addr})
+           tracer notifications discarded: 0
          actions:
            notify
        EOF
@@ -246,13 +255,14 @@ test_on_event_userspace_probe ()
        # shellcheck disable=SC2119
        start_lttng_sessiond_notap
 
-       add_trigger --condition on-event -k --userspace-probe=${uprobe_elf_binary}:test_function ma-probe --action notify
+       lttng_add_trigger_ok "T0" --condition on-event -k --userspace-probe=${uprobe_elf_binary}:test_function ma-probe --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - id: T0
          user id: ${uid}
          condition: event rule hit
            rule: ma-probe (type: userspace probe, location: ${uprobe_elf_binary}:test_function)
+           tracer notifications discarded: 0
          actions:
            notify
        EOF
@@ -267,20 +277,22 @@ test_on_event_syscall ()
        # shellcheck disable=SC2119
        start_lttng_sessiond_notap
 
-       add_trigger --condition on-event -k --syscall open --action notify
-       add_trigger --condition on-event -k --syscall ptrace --filter 'a > 2' --action notify
+       lttng_add_trigger_ok "T0" --condition on-event -k --syscall open --action notify
+       lttng_add_trigger_ok "T1" --condition on-event -k --syscall ptrace --filter 'a > 2' --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - id: T0
          user id: ${uid}
          condition: event rule hit
            rule: open (type: syscall)
+           tracer notifications discarded: 0
          actions:
            notify
        - id: T1
          user id: ${uid}
          condition: event rule hit
            rule: ptrace (type: syscall, filter: a > 2)
+           tracer notifications discarded: 0
          actions:
            notify
        EOF
@@ -294,14 +306,14 @@ test_snapshot_action ()
 {
        start_lttng_sessiond_notap
 
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --path /some/path
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --url file:///some/other/path
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4:1234:1235
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --ctrl-url=tcp://1.2.3.4:1111 --data-url=tcp://1.2.3.4:1112
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --max-size=1234
-       add_trigger --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --name=meh
+       lttng_add_trigger_ok "T0" --condition on-event -u some-event --action snapshot-session ze-session
+       lttng_add_trigger_ok "T1" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path
+       lttng_add_trigger_ok "T2" --condition on-event -u some-event --action snapshot-session ze-session --url file:///some/other/path
+       lttng_add_trigger_ok "T3" --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4
+       lttng_add_trigger_ok "T4" --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4:1234:1235
+       lttng_add_trigger_ok "T5" --condition on-event -u some-event --action snapshot-session ze-session --ctrl-url=tcp://1.2.3.4:1111 --data-url=tcp://1.2.3.4:1112
+       lttng_add_trigger_ok "T6" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --max-size=1234
+       lttng_add_trigger_ok "T7" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --name=meh
 
 
        cat > "${tmp_expected_stdout}" <<- EOF
@@ -309,48 +321,56 @@ test_snapshot_action ()
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`
        - id: T1
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, path: /some/path
        - id: T2
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, path: /some/other/path
        - id: T3
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, url: net://1.2.3.4
        - id: T4
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, url: net://1.2.3.4:1234:1235
        - id: T5
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, control url: tcp://1.2.3.4:1111, data url: tcp://1.2.3.4:1112
        - id: T6
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, path: /some/path, max size: 1234
        - id: T7
          user id: ${uid}
          condition: event rule hit
            rule: some-event (type: tracepoint, domain: ust)
+           tracer notifications discarded: 0
          actions:
            snapshot session \`ze-session\`, path: /some/path, name: meh
        EOF
This page took 0.028805 seconds and 4 git commands to generate.