X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftrigger%2Ftest_list_triggers_cli;h=b99288471d92b8ee5b446ea63143887ae2c61b75;hb=HEAD;hp=d033295479ab15978b3084701d8dca15fb0824be;hpb=dceffc9efc9bff19cef221d6620e42f30ee361d5;p=lttng-tools.git diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli index d03329547..b99288471 100755 --- a/tests/regression/tools/trigger/test_list_triggers_cli +++ b/tests/regression/tools/trigger/test_list_triggers_cli @@ -27,31 +27,21 @@ NUM_TESTS=150 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" -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) -tmp_expected_stdout_mi=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.mi.XXXXXX) +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_expected_stdout_mi=$(mktemp -t test_list_triggers_cli_expected_stdout.mi.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") uid=$(id --user) -gid=$(id --group) -if [ "$uid" == "0" ]; then - ist_root=1 - ls "$uprobe_sdt_binary" >/dev/null 2>&1 - if test $? == 0; then - hast_sdt_binary=1 - else - hast_sdt_binary=0 - fi -else - ist_root=0 - hast_sdt_binary=0 +sdt_binary_present=0 +if [ -f "$uprobe_sdt_binary" ]; then + sdt_binary_present=1 fi - test_top_level_options () { diag "Listing top level options" @@ -72,7 +62,7 @@ test_top_level_options () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -252,7 +242,7 @@ test_event_rule_matches_tracepoint () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -799,8 +789,8 @@ test_event_rule_matches_probe () diag "Listing event-rule-matches kernel probe" - channel_enable_addr=$(grep ' t lttng_channel_enable\s\[lttng_tracer\]$' /proc/kallsyms | cut -f 1 -d ' ') - channel_disable_addr=$(grep ' t lttng_channel_disable\s\[lttng_tracer\]$' /proc/kallsyms | cut -f 1 -d ' ') + channel_enable_addr=$(grep '\' /proc/kallsyms | cut -f 1 -d ' ') + channel_disable_addr=$(grep '\' /proc/kallsyms | cut -f 1 -d ' ') # We need to find a valid offset. base_symbol="" @@ -814,7 +804,7 @@ test_event_rule_matches_probe () fi offset_hex="0x$(printf '%x' $offset)" - channel_enable_addr_decimal=$(echo "ibase=16; ${channel_enable_addr^^} " | bc) + channel_enable_addr_decimal=$(printf '%u' 0x"${channel_enable_addr}") lttng_add_trigger_ok "T0" --condition event-rule-matches --type=kprobe --location=lttng_channel_enable --event-name=my_channel_enable --action notify lttng_add_trigger_ok "T1" --condition event-rule-matches --type=kprobe --location="${base_symbol}+${offset_hex}" --event-name=my_channel_enable --action notify @@ -852,7 +842,7 @@ test_event_rule_matches_probe () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1046,7 +1036,7 @@ test_event_rule_matches_userspace_probe_elf () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1140,7 +1130,7 @@ test_event_rule_matches_userspace_probe_sdt () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1271,7 +1261,7 @@ test_event_rule_matches_syscall () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1546,7 +1536,7 @@ test_session_consumed_size_condition () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1606,7 +1596,7 @@ test_buffer_usage_conditions () condition: buffer usage high session name: the-session-name channel name: the-channel-name - domain: ust + domain: user space threshold (bytes): 1234 errors: none actions: @@ -1618,7 +1608,7 @@ test_buffer_usage_conditions () condition: buffer usage high session name: the-session-name channel name: the-channel-name - domain: ust + domain: user space threshold (ratio): 0.25 errors: none actions: @@ -1630,7 +1620,7 @@ test_buffer_usage_conditions () condition: buffer usage low session name: the-session-name channel name: the-channel-name - domain: ust + domain: user space threshold (bytes): 2345 errors: none actions: @@ -1642,7 +1632,7 @@ test_buffer_usage_conditions () condition: buffer usage low session name: the-session-name channel name: the-channel-name - domain: ust + domain: user space threshold (ratio): 0.40 errors: none actions: @@ -1653,7 +1643,7 @@ test_buffer_usage_conditions () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -1842,7 +1832,7 @@ test_session_rotation_conditions () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -2034,7 +2024,7 @@ test_snapshot_action () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -2580,7 +2570,7 @@ test_notify_action () cat > "${tmp_expected_stdout_mi}" <<- EOF - + list-trigger @@ -2695,10 +2685,12 @@ start_lttng_sessiond_notap test_top_level_options test_event_rule_matches_tracepoint -skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe -skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf -skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt -skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall +check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || { + test_event_rule_matches_probe + test_event_rule_matches_userspace_probe_elf + skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt + test_event_rule_matches_syscall +} test_session_consumed_size_condition test_buffer_usage_conditions test_session_rotation_conditions