X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ffiltering%2Ftest_valid_filter;h=79a9d85f237c393317e9df6da9ae369aeb3a29d0;hb=9f2636716abf0d6cc188fed380ba77a621a370c1;hp=e76ffa25f2480998be378929cda20ef9dde369a4;hpb=33e557114a2ba28e26e220a833e8a449c78b8b65;p=lttng-tools.git diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter index e76ffa25f..79a9d85f2 100755 --- a/tests/regression/tools/filtering/test_valid_filter +++ b/tests/regression/tools/filtering/test_valid_filter @@ -9,7 +9,8 @@ TEST_DESC="Filtering - Valid filters" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. -STATS_BIN="$TESTDIR/utils/babelstats.pl" +BT2_PLUGINS_DIR="${TESTDIR}/utils/bt2_plugins" + SESSION_NAME="valid_filter" NR_ITER=100 NUM_GLOBAL_TESTS=2 @@ -94,7 +95,7 @@ function test_valid_filter event_name="$3" filter="$4" validator="$5" - local trace_path=$(mktemp --tmpdir -d tmp.test_filtering_invalid_filters_trace_path.XXXXXX) + local trace_path=$(mktemp -d -t tmp.test_filtering_valid_filters_trace_path.XXXXXX) diag "Test valid $domain_name filter: $filter" @@ -110,16 +111,12 @@ function test_valid_filter stop_lttng_tracing_ok $SESSION_NAME # Destroy session - destroy_lttng_session_ok $SESSION_NAME - - stats=`babeltrace $trace_path | $STATS_BIN --tracepoint $event_name` + destroy_lttng_session_ok $SESSION_NAME --no-wait - rm -rf $trace_path + stats=$("${BABELTRACE_BIN}" --plugin-path "${BT2_PLUGINS_DIR}" "${trace_path}" -c filter.lttngtest.event_name -p "names=[\"${event_name}\"]" -c sink.lttngtest.field_stats) $validator "$stats" - ok $? "Validate trace filter output" - rm -rf $trace_path } @@ -401,6 +398,8 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +bail_out_if_no_babeltrace + issue_356_filter="intfield > 0 && intfield > 1 && " issue_356_filter+="intfield > 2 && intfield > 3 && " issue_356_filter+="intfield > 4 && intfield > 5 && " @@ -1452,13 +1451,7 @@ KERNEL_FILTERS=( IFS=$OLDIFS -if [ "$(id -u)" == "0" ]; then - isroot=1 -else - isroot=0 -fi - -skip $isroot "Root access is needed. Skipping all kernel valid filter tests." $NUM_KERNEL_TESTS || +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests." || { diag "Test kernel valid filters"