X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fpython-logging%2Ftest_python_logging.in;h=470452260eb49132258425ab7a914e62bbe6f58f;hb=63dd3d7b5b0979c4b11a6bb8d0e4155120482977;hp=342bac2f65ca8b56105011d808e18eb1636a4861;hpb=eb7277b0337e67b56606d3c7f4114ac5a22ec34c;p=lttng-tools.git diff --git a/tests/regression/ust/python-logging/test_python_logging.in b/tests/regression/ust/python-logging/test_python_logging.in index 342bac2f6..470452260 100755 --- a/tests/regression/ust/python-logging/test_python_logging.in +++ b/tests/regression/ust/python-logging/test_python_logging.in @@ -25,7 +25,7 @@ run_test=@RUN_PYTHON_AGENT_TEST@ if [[ -z "$run_test" ]]; then NUM_TESTS=1 else - NUM_TESTS=$(((194 * ${#python_versions[@]})+2)) + NUM_TESTS=$(((199 * ${#python_versions[@]})+2)) fi source $TESTDIR/utils/utils.sh @@ -106,8 +106,8 @@ function enable_python_filter_loglevel_only() function test_python_before_start () { - local ready_file=$(mktemp -u) - local go_file=$(mktemp -u) + local ready_file=$(mktemp --tmpdir -u) + local go_file=$(mktemp --tmpdir -u) diag "Test Python application BEFORE tracing starts" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -685,6 +685,35 @@ function test_python_filter_loglevel() fi } +function test_python_trigger_notify_action +{ + uid=$(id --user) + tmp_expected_stdout=$(mktemp --tmpdir -t test_list_triggers_python_cli_expected_stdout.XXXXXX) + + diag "Test Python trigger with notify action" + + lttng_add_trigger_ok "my_python_trigger" \ + --condition event-rule-matches --type=python --action notify + + cat > "${tmp_expected_stdout}" <<- EOF + - name: my_python_trigger + owner uid: ${uid} + condition: event rule matches + rule: * (type: python:logging) + errors: none + actions: + notify + errors: none + errors: none + EOF + + list_triggers_matches_ok "Python trigger listing" "${tmp_expected_stdout}" + + lttng_remove_trigger_ok "my_python_trigger" + + rm -f "${tmp_expected_stdout}" +} + plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" @@ -717,6 +746,7 @@ skip $skip_agent "Python agent test skipped." $NUM_TESTS || test_python_after_start test_python_multi_session test_python_filter_loglevel + test_python_trigger_notify_action ) @@ -724,7 +754,7 @@ skip $skip_agent "Python agent test skipped." $NUM_TESTS || do for fct_test in ${tests[@]}; do - TRACE_PATH=$(mktemp -d) + TRACE_PATH=$(mktemp --tmpdir -d tmp.test_python_logging_trace_path.XXXXXX) diag "(Python $python_version)" ${fct_test} $python_version