X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ffiltering%2Ftest_invalid_filter;h=68bbdc18cef8558020ac1e2151e3de9fa524a76f;hb=343af227102f6b274bfd7f6c7220eb3b776ba5e3;hp=9df5f2cbfc439bfd542633e6b11126537e146dcc;hpb=5da9cf86d63bcb9d4d077155efc707048df4fd0c;p=lttng-tools.git diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter index 9df5f2cbf..68bbdc18c 100755 --- a/tests/regression/tools/filtering/test_invalid_filter +++ b/tests/regression/tools/filtering/test_invalid_filter @@ -25,8 +25,8 @@ EVENT_NAME="bogus" ENABLE_EVENT_STDERR="/tmp/invalid-filters-stderr" TRACE_PATH=$(mktemp -d) NUM_GLOBAL_TESTS=2 -NUM_UST_TESTS=123 -NUM_KERNEL_TESTS=123 +NUM_UST_TESTS=165 +NUM_KERNEL_TESTS=165 NUM_TESTS=$(($NUM_UST_TESTS+$NUM_KERNEL_TESTS+$NUM_GLOBAL_TESTS)) source $TESTDIR/utils/utils.sh @@ -93,6 +93,7 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +OLDIFS="$IFS" IFS=$'\n' INVALID_FILTERS=( # Unsupported ops @@ -142,15 +143,35 @@ INVALID_FILTERS=( # Only \$ctx is supported for now "\$global.value == 0" "0 == \$global.value" - # A wildcard should only appear as the last character in a string literal - "msg == \"my_event*_blah\"" - ) + # Cannot compare two full star globbing patterns + '"hello*world" == "yes*man"' + '"hello*world" == "yesman*"' + '"helloworld*" == "yes*man"' + # May only use != and == operators when one of them is a full + # star globbing pattern + '"hello*world" < field' + '"hello*world" <= field' + '"hello*world" >= field' + '"hello*world" > field' + '"hello*world" || field' + '"hello*world" && field' + 'field < "hello*world"' + 'field <= "hello*world"' + 'field >= "hello*world"' + 'field > "hello*world"' + 'field && "hello*world"' + 'field || "hello*world"' +) +IFS="$OLDIFS" start_lttng_sessiond diag "Test UST filters" -for FILTER in ${INVALID_FILTERS[@]}; -do - test_invalid_filter -u "$FILTER" + +i=0 +while [ "$i" -lt "${#INVALID_FILTERS[@]}" ]; do + echo "${INVALID_FILTERS[$i]}" + test_invalid_filter -u "${INVALID_FILTERS[$i]}" + let "i++" done test_bytecode_limit -u @@ -164,15 +185,15 @@ fi skip $isroot "Root access is needed. Skipping all kernel invalid filter tests." $NUM_KERNEL_TESTS || { diag "Test kernel filters" - for FILTER in ${INVALID_FILTERS[@]}; - do - test_invalid_filter -k "$FILTER" + i=0 + while [ "$i" -lt "${#INVALID_FILTERS[@]}" ]; do + echo "${INVALID_FILTERS[$i]}" + test_invalid_filter -k "${INVALID_FILTERS[$i]}" + let "i++" done test_bytecode_limit -k } - -unset IFS stop_lttng_sessiond rm -f $ENABLE_EVENT_STDERR