lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 May 2017 15:03:43 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     linux-kselftest@...r.kernel.org, shuah@...nel.org,
        Steven Rostedt <rostedt@...dmis.org>
Cc:     mhiramat@...nel.org, Ingo Molnar <mingo@...hat.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/7] selftests/ftrace: Skip full-glob-matching filter test on older kernel

Skip a part of ftrace filter test related to full-glob
matching if we are sure that the testing kernel is so old
that it does not support full-glob-matching yet.

Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
 .../ftrace/test.d/ftrace/func-filter-glob.tc       |   28 ++++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
index 9dcd0ca..8095e12 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
@@ -11,17 +11,6 @@ fi
 disable_tracing
 clear_trace
 
-# filter by ?, schedule is always good
-if ! echo "sch?dule" > set_ftrace_filter; then
-    # test for powerpc 64
-    if ! echo ".sch?dule" > set_ftrace_filter; then
-	fail "can not enable schedule filter"
-    fi
-    cat set_ftrace_filter | grep '^.schedule$'
-else
-    cat set_ftrace_filter | grep '^schedule$'
-fi
-
 ftrace_filter_check() { # glob grep
   echo "$1" > set_ftrace_filter
   cut -f1 -d" " set_ftrace_filter > $TMPDIR/actual
@@ -39,11 +28,28 @@ ftrace_filter_check '*schedule*' '^.*schedule.*$'
 # filter by *, end match
 ftrace_filter_check 'schedule*' '^schedule.*$'
 
+# Advanced full-glob matching feature is recently supported.
+# Skip the tests if we are sure the kernel does not support it.
+if grep -q 'accepts: .* glob-matching-pattern' README ; then
+
 # filter by *, both side match
 ftrace_filter_check 'sch*ule' '^sch.*ule$'
 
 # filter by char class.
 ftrace_filter_check '[Ss]y[Ss]_*' '^[Ss]y[Ss]_.*$'
 
+# filter by ?, schedule is always good
+if ! echo "sch?dule" > set_ftrace_filter; then
+    # test for powerpc 64
+    if ! echo ".sch?dule" > set_ftrace_filter; then
+	fail "can not enable schedule filter"
+    fi
+    cat set_ftrace_filter | grep '^.schedule$'
+else
+    cat set_ftrace_filter | grep '^schedule$'
+fi
+
+fi
+
 echo > set_ftrace_filter
 enable_tracing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ