From e0bd0ea37926566b1518e894f624d78e9526337f Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 8 Oct 2015 14:01:40 -0400 Subject: [PATCH] Limit the scope of IFS overwriting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The overwrite caused a folder ' ' to be created locally when running root tests. Use while loop to preserve space in invalid filter string. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- .../tools/filtering/test_invalid_filter | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter index 9df5f2cbf..ebf4c3bb1 100755 --- a/tests/regression/tools/filtering/test_invalid_filter +++ b/tests/regression/tools/filtering/test_invalid_filter @@ -93,6 +93,7 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +OLDIFS="$IFS" IFS=$'\n' INVALID_FILTERS=( # Unsupported ops @@ -144,13 +145,17 @@ INVALID_FILTERS=( "0 == \$global.value" # A wildcard should only appear as the last character in a string literal "msg == \"my_event*_blah\"" - ) +) +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 +169,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 -- 2.34.1