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-next>] [day] [month] [year] [list]
Message-Id: <20220629034007.332804-1-irogers@google.com>
Date:   Tue, 28 Jun 2022 20:40:07 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Richter <tmricht@...ux.ibm.com>,
        Claire Jensen <cjense@...gle.com>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Stephane Eranian <eranian@...gle.com>
Subject: [PATCH] perf test: Skip for paranoid 3

Add skip tests for paranoid level being 3.
Rather than skipping lines starting "Failed", skip lines containing
"failed" - making the behavior consistent with the previous python
version.

Fixes: ec906102e5b7 ("perf test: Fix "perf stat CSV output linter" test on s390")
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
 tools/perf/tests/shell/stat+csv_output.sh | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/shell/stat+csv_output.sh b/tools/perf/tests/shell/stat+csv_output.sh
index 38c26f3ef4c1..b165c81fccb4 100755
--- a/tools/perf/tests/shell/stat+csv_output.sh
+++ b/tools/perf/tests/shell/stat+csv_output.sh
@@ -26,9 +26,8 @@ function commachecker()
 
 	while read line
 	do
-		# Check for lines beginning with Failed
-		x=${line:0:6}
-		[ "$x" = "Failed" ] && continue
+		# Skip lines containing failed.
+		(echo "$line" | grep -q "failed") && continue
 
 		# Count the number of commas
 		x=$(echo $line | tr -d -c ',')
@@ -51,6 +50,11 @@ function ParanoidAndNotRoot()
 check_no_args()
 {
 	echo -n "Checking CSV output: no args "
+	if ParanoidAndNotRoot 2
+	then
+		echo "[Skip] paranoid and not root"
+		return
+	fi
 	perf stat -x, true 2>&1 | commachecker --no-args
 	echo "[Success]"
 }
@@ -83,6 +87,11 @@ check_system_wide_no_aggr()
 check_interval()
 {
 	echo -n "Checking CSV output: interval "
+	if ParanoidAndNotRoot 2
+	then
+		echo "[Skip] paranoid and not root"
+		return
+	fi
 	perf stat -x, -I 1000 true 2>&1 | commachecker --interval
 	echo "[Success]"
 }
@@ -91,6 +100,11 @@ check_interval()
 check_event()
 {
 	echo -n "Checking CSV output: event "
+	if ParanoidAndNotRoot 2
+	then
+		echo "[Skip] paranoid and not root"
+		return
+	fi
 	perf stat -x, -e cpu-clock true 2>&1 | commachecker --event
 	echo "[Success]"
 }
-- 
2.37.0.rc0.161.g10f37bed90-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ