X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ffiltering%2Ftest_valid_filter;h=e76ffa25f2480998be378929cda20ef9dde369a4;hb=33e557114a2ba28e26e220a833e8a449c78b8b65;hp=725d82d4af74c87fad668619575c066edd1fa00b;hpb=0358f3d86acfd1ccf9dc8d283cb251c56f351730;p=lttng-tools.git diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter index 725d82d4a..e76ffa25f 100755 --- a/tests/regression/tools/filtering/test_valid_filter +++ b/tests/regression/tools/filtering/test_valid_filter @@ -1,31 +1,20 @@ #!/bin/bash # -# Copyright (C) - 2012 Christian Babeux +# Copyright (C) 2012 Christian Babeux # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License, version 2 only, as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. TEST_DESC="Filtering - Valid filters" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. -LTTNG_BIN="lttng" STATS_BIN="$TESTDIR/utils/babelstats.pl" SESSION_NAME="valid_filter" NR_ITER=100 NUM_GLOBAL_TESTS=2 -NUM_UST_TESTS=1098 -NUM_KERNEL_TESTS=1032 +NUM_UST_TESTS=1122 +NUM_KERNEL_TESTS=1056 NUM_TESTS=$(($NUM_UST_TESTS+$NUM_KERNEL_TESTS+$NUM_GLOBAL_TESTS)) source $TESTDIR/utils/utils.sh @@ -105,11 +94,10 @@ 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) diag "Test valid $domain_name filter: $filter" - trace_path=$(mktemp -d) - # Create session create_lttng_session_ok $SESSION_NAME $trace_path @@ -719,10 +707,16 @@ UST_FILTERS=( "(1<<63) < 0" true_statement - "1<<1==2" # C99 operator priority: comparator before bitwise + "(1<<2!=4)==0" # operator priority: shift before equality - has_no_event - "!(1<<1==2)" # C99 operator priority: comparator before bitwise + true_statement + "1&3==1" # operator priority: masks before equality + + true_statement + "(3|1==3)==1" # operator priority: masks before equality + + true_statement + "(2^1==3)==1" # operator priority: masks before equality true_statement "(1 << 32) == 4294967296" @@ -838,6 +832,16 @@ UST_FILTERS=( has_no_event "0 == \$ctx.vtid.blah" + # check that bytecode linker refuses to link against a + # non-string array. + has_no_event + 'arrfield1 != "dontmatch"' + + # check that bytecode linker refuses to link against a + # non-string sequence. + has_no_event + 'seqfield1 != "dontmatch"' + END ) @@ -1192,10 +1196,16 @@ KERNEL_FILTERS=( "(1<<63) < 0" true_statement - "1<<1==2" # C99 operator priority: comparator before bitwise + "(1<<2!=4)==0" # operator priority: shift before equality - has_no_event - "!(1<<1==2)" # C99 operator priority: comparator before bitwise + true_statement + "1&3==1" # operator priority: masks before equality + + true_statement + "(3|1==3)==1" # operator priority: masks before equality + + true_statement + "(2^1==3)==1" # operator priority: masks before equality true_statement "(1 << 32) == 4294967296" @@ -1425,6 +1435,16 @@ KERNEL_FILTERS=( has_no_event 'stringfield == "test\*"' + # check that bytecode linker refuses to link against a + # non-string array. + has_no_event + 'arrfield1 != "dontmatch"' + + # check that bytecode linker refuses to link against a + # non-string sequence. + has_no_event + 'seqfield1 != "dontmatch"' + ${KIRK_KRAUSS_TESTS[@]} END @@ -1464,7 +1484,7 @@ skip $isroot "Root access is needed. Skipping all kernel valid filter tests." $N i=$(( i + 2 )) done - rmmod lttng-test + modprobe --remove lttng-test } stop_lttng_sessiond