From: Jonathan Rajotte Date: Thu, 8 Oct 2015 18:01:40 +0000 (-0400) Subject: Limit the scope of IFS overwriting X-Git-Tag: v2.8.0-rc1~89 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e0bd0ea37926566b1518e894f624d78e9526337f;p=lttng-tools.git Limit the scope of IFS overwriting 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 --- 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