uid=$(id --user)
gid=$(id --group)
-function add_trigger ()
-{
- "${FULL_LTTNG_BIN}" add-trigger "$@"
- ok $? "add trigger \`$*\`: exit code is 0"
-}
-
function list_triggers ()
{
local test_name="$1"
start_lttng_sessiond_notap
# Add a few triggers
-add_trigger --condition on-event -u -a --action notify
-add_trigger --id ABC --condition on-event aaa -u --filter 'p == 2' --action notify
+lttng_add_trigger_ok "ABC" --condition on-event aaa -u --filter 'p == 2' --action notify
+lttng_add_trigger_ok "DEF" --condition on-event -u -a --action notify
cat > "${tmp_expected_stdout}" <<- EOF
- id: ABC
rule: aaa (type: tracepoint, domain: ust, filter: p == 2)
actions:
notify
-- id: T0
+- id: DEF
user id: ${uid}
condition: event rule hit
rule: * (type: tracepoint, domain: ust)
remove_trigger "ABC"
cat > "${tmp_expected_stdout}" <<- EOF
-- id: T0
+- id: DEF
user id: ${uid}
condition: event rule hit
rule: * (type: tracepoint, domain: ust)
EOF
list_triggers "one trigger left" "${tmp_expected_stdout}"
-remove_trigger "T0"
+remove_trigger "DEF"
list_triggers "no triggers left" "/dev/null"