Rename lttng_event_rule_kernel_probe to lttng_event_rule_kernel_kprobe
[lttng-tools.git] / tests / regression / tools / trigger / test_list_triggers_cli
index cb7a3b4760d68f0c0da14c27ba2890a685228314..5366a030ccc1434347a05aab15dff6c6a7da9176 100755 (executable)
@@ -27,9 +27,9 @@ NUM_TESTS=106
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
-tmp_stdout=$(mktemp -t test_list_triggers_cli_stdout.XXXXXX)
-tmp_stderr=$(mktemp -t test_list_triggers_cli_stderr.XXXXXX)
-tmp_expected_stdout=$(mktemp -t test_list_triggers_cli_expected_stdout.XXXXXX)
+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)
 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")
@@ -51,21 +51,6 @@ else
 fi
 
 
-function list_triggers_matches_ok ()
-{
-       local test_name="$1"
-       local expected_stdout_file="$2"
-
-       "${FULL_LTTNG_BIN}" list-triggers > "${tmp_stdout}" 2> "${tmp_stderr}"
-       ok $? "${test_name}: exit code is 0"
-
-       diff -u "${expected_stdout_file}" "${tmp_stdout}"
-       ok $? "${test_name}: expected stdout"
-
-       diff -u /dev/null "${tmp_stderr}"
-       ok $? "${test_name}: expected stderr"
-}
-
 test_top_level_options ()
 {
        diag "Listing top level options"
@@ -240,7 +225,7 @@ test_event_rule_matches_probe ()
        - name: T0
          owner uid: ${uid}
          condition: event rule matches
-           rule: my_channel_enable (type: probe, location: lttng_channel_enable)
+           rule: my_channel_enable (type: kernel:kprobe, location: lttng_channel_enable)
          actions:
            notify
              errors: none
@@ -248,7 +233,7 @@ test_event_rule_matches_probe ()
        - name: T1
          owner uid: ${uid}
          condition: event rule matches
-           rule: my_channel_enable (type: probe, location: ${base_symbol}+${offset_hex})
+           rule: my_channel_enable (type: kernel:kprobe, location: ${base_symbol}+${offset_hex})
          actions:
            notify
              errors: none
@@ -256,7 +241,7 @@ test_event_rule_matches_probe ()
        - name: T2
          owner uid: ${uid}
          condition: event rule matches
-           rule: my_channel_enable (type: probe, location: 0x${channel_enable_addr})
+           rule: my_channel_enable (type: kernel:kprobe, location: 0x${channel_enable_addr})
          actions:
            notify
              errors: none
@@ -276,13 +261,13 @@ test_event_rule_matches_userspace_probe_elf ()
 
        diag "Listing event-rule-matches userspace-probe elf"
 
-       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe-elf --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe-elf --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
          owner uid: ${uid}
          condition: event rule matches
-           rule: ma-probe-elf (type: userspace probe, location type: ELF, location: ${uprobe_elf_binary}:${elf_function_name})
+           rule: ma-probe-elf (type: kernel:uprobe, location type: ELF, location: ${uprobe_elf_binary}:${elf_function_name})
          actions:
            notify
              errors: none
@@ -301,13 +286,13 @@ test_event_rule_matches_userspace_probe_sdt ()
 
        diag "Listing event-rule-matches userspace-probe sdt"
 
-       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=uprobe --location=sdt:${uprobe_sdt_binary}:${sdt_provider_name}:${sdt_probe_name} --event-name=ma-probe-sdt --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=kernel:uprobe --location=sdt:${uprobe_sdt_binary}:${sdt_provider_name}:${sdt_probe_name} --event-name=ma-probe-sdt --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
          owner uid: 0
          condition: event rule matches
-           rule: ma-probe-sdt (type: userspace probe, location type: SDT, location: ${uprobe_sdt_binary}:${sdt_provider_name}:${sdt_probe_name})
+           rule: ma-probe-sdt (type: kernel:uprobe, location type: SDT, location: ${uprobe_sdt_binary}:${sdt_provider_name}:${sdt_probe_name})
          actions:
            notify
              errors: none
@@ -333,7 +318,7 @@ test_event_rule_matches_syscall ()
        - name: T0
          owner uid: ${uid}
          condition: event rule matches
-           rule: open (type: syscall:entry+exit)
+           rule: open (type: kernel:syscall:entry+exit)
          actions:
            notify
              errors: none
@@ -341,7 +326,7 @@ test_event_rule_matches_syscall ()
        - name: T1
          owner uid: ${uid}
          condition: event rule matches
-           rule: open (type: syscall:entry)
+           rule: open (type: kernel:syscall:entry)
          actions:
            notify
              errors: none
@@ -349,7 +334,7 @@ test_event_rule_matches_syscall ()
        - name: T2
          owner uid: ${uid}
          condition: event rule matches
-           rule: open (type: syscall:exit)
+           rule: open (type: kernel:syscall:exit)
          actions:
            notify
              errors: none
@@ -357,7 +342,7 @@ test_event_rule_matches_syscall ()
        - name: T3
          owner uid: ${uid}
          condition: event rule matches
-           rule: open (type: syscall:entry+exit)
+           rule: open (type: kernel:syscall:entry+exit)
          actions:
            notify
              errors: none
@@ -365,7 +350,7 @@ test_event_rule_matches_syscall ()
        - name: T4
          owner uid: ${uid}
          condition: event rule matches
-           rule: ptrace (type: syscall:entry+exit, filter: a > 2)
+           rule: ptrace (type: kernel:syscall:entry+exit, filter: a > 2)
          actions:
            notify
              errors: none
@@ -575,7 +560,7 @@ test_snapshot_action ()
          condition: event rule matches
            rule: some-event (type: tracepoint, domain: ust)
          actions:
-           snapshot session \`ze-session\`, rate policy: after every 10 occurrences
+           snapshot session \`ze-session\`, rate policy: every 10 occurrences
              errors: none
          errors: none
        - name: T9
@@ -621,7 +606,7 @@ test_notify_action ()
          condition: event rule matches
            rule: some-event (type: tracepoint, domain: ust)
          actions:
-           notify, rate policy: after every 10 occurrences
+           notify, rate policy: every 10 occurrences
              errors: none
          errors: none
        EOF
This page took 0.026705 seconds and 5 git commands to generate.