port: add missing attributes in getrandom_nonblock() on macOS
[lttng-tools.git] / tests / regression / tools / trigger / test_add_trigger_cli
index 62430279505173b766d531f6061fbd8a75d2debc..52bbe74029807e978bab09fcf65e9c9df6db497e 100755 (executable)
@@ -23,15 +23,15 @@ TESTDIR="$CURDIR/../../.."
 # shellcheck source=../../../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
-plan_tests 286
+plan_tests 295
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
 # shellcheck disable=SC2119
 start_lttng_sessiond_notap
 
-tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX)
-tmp_stderr=$(mktemp --tmpdir -t test_parse_cli_trigger_stderr.XXXXXX)
+tmp_stdout=$(mktemp -t test_parse_cli_trigger_stdout.XXXXXX)
+tmp_stderr=$(mktemp -t test_parse_cli_trigger_stderr.XXXXXX)
 uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary"
 
 if [ "$(id -u)" == "0" ]; then
@@ -86,8 +86,8 @@ function test_mi ()
        # the one used by the list command. Here we simply validate that a
        # simple trigger is correctly generated.
 
-       tmp_stdout_raw=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX")
-       tmp_expected_stdout=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX")
+       tmp_stdout_raw=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX")
+       tmp_expected_stdout=$(mktemp -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX")
 
        diag "${FULL_LTTNG_BIN} --mi=xml add-trigger"
 
@@ -450,11 +450,20 @@ test_failure "invalid argument to --rate-policy: unknown policy type" \
 
 # `--condition` failures
 test_failure "missing args after --condition" \
-       "Error: While parsing argument #2 (\`--condition\`): Missing required argument for option \`--condition\`" \
+       "Error: While parsing argument #2 (\`--condition\`): Missing required argument for option \`--condition\`
+Error: Valid condition names are:
+Error:   event-rule-matches" \
        --condition
 test_failure "unknown --condition" \
-       "Error: Unknown condition name 'zoofest'" \
+       "Error: While parsing argument #2 (\`--condition\`): Unknown condition name 'zoofest'
+Error: Valid condition names are:
+Error:   event-rule-matches" \
        --condition zoofest
+test_failure "unknown --condition=" \
+       "Error: While parsing argument #2 (\`--condition=zoofest\`): Unknown condition name 'zoofest'
+Error: Valid condition names are:
+Error:   event-rule-matches" \
+       --condition=zoofest
 
 # `--condition event-rule-matches` failures
 test_failure "missing args after --condition event-rule-matches" \
@@ -548,10 +557,26 @@ test_failure "--condition event-rule-matches --capture: missing colon in app-spe
 
 # `--action` failures
 test_failure "missing args after --action" \
-       "Error: While parsing argument #5 (\`--action\`): Missing required argument for option \`--action\`" \
+       "Error: While parsing argument #5 (\`--action\`): Missing required argument for option \`--action\`
+Error: Valid action names are:
+Error:   notify" \
        --condition event-rule-matches --type=user \
        --action
 
+test_failure "unknown --action" \
+       "Error: While parsing argument #5 (\`--action\`): Unknown action name 'zoofest'
+Error: Valid action names are:
+Error:   notify" \
+       --condition event-rule-matches --type=user \
+       --action zoofest
+
+test_failure "unknown --action=" \
+       "Error: While parsing argument #5 (\`--action=zoofest\`): Unknown action name 'zoofest'
+Error: Valid action names are:
+Error:   notify" \
+       --condition event-rule-matches --type=user \
+       --action=zoofest
+
 # `--action notify` failures
 test_failure "extra arg after --action notify" \
        "Error: Unexpected argument \`bob\`." \
This page took 0.024588 seconds and 4 git commands to generate.