From c87b9c601ac862b1fa41a9d759a3c05711a8391d Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Sat, 28 Sep 2013 14:12:21 -0700 Subject: rcutorture: Add KVM-based test framework This commit adds the test framework that I used to test RCU under KVM. This consists of a group of scripts and Kconfig fragments. Signed-off-by: Paul E. McKenney Cc: Greg KH --- .../selftests/rcutorture/bin/parse-console.sh | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/testing/selftests/rcutorture/bin/parse-console.sh (limited to 'tools/testing/selftests/rcutorture/bin/parse-console.sh') diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh new file mode 100755 index 00000000000..bc1496fa126 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Check the console output from an rcutorture run for oopses. +# The "file" is a pathname on the local system, and "title" is +# a text string for error-message purposes. +# +# Usage: +# sh parse-console.sh file title +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Copyright (C) IBM Corporation, 2011 +# +# Authors: Paul E. McKenney + +T=/tmp/abat-chk-badness.sh.$$ +trap 'rm -f $T' 0 + +file="$1" +title="$2" + +egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T +if test -s $T +then + echo Assertion failure in $file $title + cat $T +fi -- cgit v1.2.3-70-g09d2 From 6d40cc0cb4311d0c5aa4a106cc86a3d45a9ad86c Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 28 Oct 2013 06:34:22 -0700 Subject: rcutorture: Flag errors and warnings with color coding The output of the rcutorture scripts often requires interpretation, so this commit simplifies this interpretation by tagging messages as BUGs (colored red) or WARNINGs (colored yellow). Reported-by: Ingo Molnar Signed-off-by: Paul E. McKenney Cc: Greg KH --- tools/testing/selftests/rcutorture/bin/functions.sh | 16 ++++++++++++++++ .../testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | 5 ++--- tools/testing/selftests/rcutorture/bin/parse-build.sh | 18 ++++++++++++++---- .../testing/selftests/rcutorture/bin/parse-console.sh | 4 +++- .../selftests/rcutorture/bin/parse-rcutorture.sh | 10 ++++++---- 5 files changed, 41 insertions(+), 12 deletions(-) (limited to 'tools/testing/selftests/rcutorture/bin/parse-console.sh') diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh index d0d19ebd2a9..963b6f04d4e 100644 --- a/tools/testing/selftests/rcutorture/bin/functions.sh +++ b/tools/testing/selftests/rcutorture/bin/functions.sh @@ -134,6 +134,22 @@ identify_qemu_vcpus () { lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://' } +# print_bug +# +# Prints "BUG: " in red followed by remaining arguments +print_bug () { + printf '\033[031mBUG: \033[m' + echo $* +} + +# print_warning +# +# Prints "WARNING: " in yellow followed by remaining arguments +print_warning () { + printf '\033[033mWARNING: \033[m' + echo $* +} + # specify_qemu_cpus qemu-cmd qemu-args #cpus # # Appends a string containing "-smp XXX" to qemu-args, unless the incoming diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh index 3df1581e78a..46f97d33e1b 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh @@ -188,6 +188,5 @@ then fi cp $builddir/console.log $resdir -parse-rcutorture.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 -parse-console.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 -cat $resdir/Warnings +parse-rcutorture.sh $resdir/console.log $title +parse-console.sh $resdir/console.log $title diff --git a/tools/testing/selftests/rcutorture/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/parse-build.sh index 2e0e9f7ebbb..9da2c7ba3fc 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-build.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-build.sh @@ -30,18 +30,28 @@ T=$1 title=$2 +. functions.sh + if grep -q CC < $T then : else - echo $title no build + print_bug $title no build exit 1 fi -if egrep -q "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T +if grep -q "error:" < $T +then + print_bug $title build errors: + grep "error:" < $T + exit 2 +fi +exit 0 + +if egrep -q "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T then - echo $title build errors: - egrep "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T + print_warning $title build errors: + egrep "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T exit 2 fi exit 0 diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh index bc1496fa126..8f4be78f06b 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-console.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh @@ -31,9 +31,11 @@ trap 'rm -f $T' 0 file="$1" title="$2" +. functions.sh + egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T if test -s $T then - echo Assertion failure in $file $title + print_warning Assertion failure in $file $title cat $T fi diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh index 37368a046a9..ac2f75a8322 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh @@ -34,6 +34,8 @@ title="$2" trap 'rm -f $T.seq' 0 +. functions.sh + # check for presence of rcutorture.txt file if test -f "$file" -a -r "$file" @@ -49,7 +51,7 @@ fi if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file then nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` - echo $title FAILURE, $nerrs instances + print_bug $title FAILURE, $nerrs instances echo " " $url exit fi @@ -84,21 +86,21 @@ if grep -q SUCCESS $file then if test -s $T.seq then - echo WARNING $title `cat $T.seq` + print_warning $title $title `cat $T.seq` echo " " $file exit 2 fi else if grep -q RCU_HOTPLUG $file then - echo WARNING: HOTPLUG FAILURES $title `cat $T.seq` + print_warning HOTPLUG FAILURES $title `cat $T.seq` echo " " $file exit 3 fi echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages if test -s $T.seq then - echo WARNING $title `cat $T.seq` + print_warning $title `cat $T.seq` fi exit 2 fi -- cgit v1.2.3-70-g09d2 From 0e342a87d5f0cd06697c3fdc5e8b49c61e558231 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Tue, 3 Dec 2013 09:54:18 -0800 Subject: rcutorture: Stop tracking FSF's postal address All of the rcutorture scripts has the usual GPL header, which contains a long-obsolete postal address for FSF. To avoid the need to track the FSF office's movements, this commit substitutes the URL where GPL may be found. Reported-by: Greg KH Reported-by: Steven Rostedt Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/bin/config2frag.sh | 4 ++-- .../testing/selftests/rcutorture/bin/configNR_CPUS.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/configcheck.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/configinit.sh | 18 ++++++++++++++++++ tools/testing/selftests/rcutorture/bin/cpus2use.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/functions.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/kvm-build.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/kvm-recheck.sh | 4 ++-- .../testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/parse-build.sh | 4 ++-- .../testing/selftests/rcutorture/bin/parse-console.sh | 4 ++-- .../selftests/rcutorture/bin/parse-rcutorture.sh | 4 ++-- .../selftests/rcutorture/configs/v0.0/ver_functions.sh | 4 ++-- .../selftests/rcutorture/configs/v3.3/ver_functions.sh | 4 ++-- .../selftests/rcutorture/configs/v3.5/ver_functions.sh | 4 ++-- .../selftests/rcutorture/configs/ver_functions.sh | 4 ++-- 17 files changed, 50 insertions(+), 32 deletions(-) (limited to 'tools/testing/selftests/rcutorture/bin/parse-console.sh') diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh b/tools/testing/selftests/rcutorture/bin/config2frag.sh index 252f769c17b..9f9ffcd427d 100644 --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh @@ -15,8 +15,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh index 9e8b11206dc..43540f1828c 100755 --- a/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh +++ b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh @@ -18,8 +18,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh b/tools/testing/selftests/rcutorture/bin/configcheck.sh index a3e5b9272b4..d686537dd55 100755 --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh @@ -12,8 +12,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh index 939c16cd03a..a1be6e62add 100755 --- a/tools/testing/selftests/rcutorture/bin/configinit.sh +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh @@ -13,6 +13,24 @@ # The second argument is a optional path to a build output directory, # for example, "O=/tmp/foo". If this argument is omitted, the .config # file will be generated directly in the current directory. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. +# +# Copyright (C) IBM Corporation, 2013 +# +# Authors: Paul E. McKenney T=/tmp/configinit.sh.$$ trap 'rm -rf $T' 0 diff --git a/tools/testing/selftests/rcutorture/bin/cpus2use.sh b/tools/testing/selftests/rcutorture/bin/cpus2use.sh index 277a3f6c821..abe14b7f36e 100755 --- a/tools/testing/selftests/rcutorture/bin/cpus2use.sh +++ b/tools/testing/selftests/rcutorture/bin/cpus2use.sh @@ -15,8 +15,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh index 3052f1bea6b..587561d7c03 100644 --- a/tools/testing/selftests/rcutorture/bin/functions.sh +++ b/tools/testing/selftests/rcutorture/bin/functions.sh @@ -13,8 +13,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh index 8c4aa7d6339..197901ec10b 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh @@ -15,8 +15,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh index 874cd32d048..baef09f3469 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh @@ -17,8 +17,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh index 46f97d33e1b..151b2378893 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh @@ -31,8 +31,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index 7ba375ebe39..1b7923bf6a7 100644 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh @@ -20,8 +20,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/parse-build.sh index 9da2c7ba3fc..543230951c3 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-build.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-build.sh @@ -20,8 +20,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh index 8f4be78f06b..4185d4cab32 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-console.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh @@ -18,8 +18,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh index ac2f75a8322..dd0a275d979 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh @@ -21,8 +21,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2011 # diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh index af7d59bf098..e8052539af5 100644 --- a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh @@ -13,8 +13,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh index 921fec93111..c37432f3572 100644 --- a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh @@ -13,8 +13,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh index 401974455ae..6a5f13aab44 100644 --- a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh @@ -13,8 +13,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # diff --git a/tools/testing/selftests/rcutorture/configs/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/ver_functions.sh index f99f23bc393..5e40eadea77 100644 --- a/tools/testing/selftests/rcutorture/configs/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/ver_functions.sh @@ -13,8 +13,8 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, you can access it online at +# http://www.gnu.org/licenses/gpl-2.0.html. # # Copyright (C) IBM Corporation, 2013 # -- cgit v1.2.3-70-g09d2