Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcutorture: Move checkarg to functions.sh

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>

+27 -22
+24
tools/testing/selftests/rcutorture/bin/functions.sh
··· 28 28 echo "$1" | grep -q "rcutorture\.onoff_" 29 29 } 30 30 31 + # checkarg --argname argtype $# arg mustmatch cannotmatch 32 + # 33 + # Checks the specified argument "arg" against the mustmatch and cannotmatch 34 + # patterns. 35 + checkarg () { 36 + if test $3 -le 1 37 + then 38 + echo $1 needs argument $2 matching \"$5\" 39 + usage 40 + fi 41 + if echo "$4" | grep -q -e "$5" 42 + then 43 + : 44 + else 45 + echo $1 $2 \"$4\" must match \"$5\" 46 + usage 47 + fi 48 + if echo "$4" | grep -q -e "$6" 49 + then 50 + echo $1 $2 \"$4\" must not match \"$6\" 51 + usage 52 + fi 53 + } 54 + 31 55 # configfrag_boot_params bootparam-string config-fragment-file 32 56 # 33 57 # Adds boot parameters from the .boot file, if any.
+3 -22
tools/testing/selftests/rcutorture/bin/kvm.sh
··· 32 32 33 33 dur=30 34 34 KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM 35 + PATH=${KVM}/bin:$PATH; export PATH 35 36 builddir="${KVM}/b1" 36 37 RCU_INITRD="$KVM/initrd"; export RCU_INITRD 37 38 RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG ··· 40 39 configs="" 41 40 ds=`date +%Y.%m.%d-%H:%M:%S` 42 41 kversion="" 42 + 43 + . functions.sh 43 44 44 45 usage () { 45 46 echo "Usage: $scriptname optional arguments:" ··· 61 58 echo " --results absolute-pathname" 62 59 echo " --relbuilddir relative-pathname" 63 60 exit 1 64 - } 65 - 66 - # checkarg --argname argtype $# arg mustmatch cannotmatch 67 - checkarg () { 68 - if test $3 -le 1 69 - then 70 - echo $1 needs argument $2 matching \"$5\" 71 - usage 72 - fi 73 - if echo "$4" | grep -q -e "$5" 74 - then 75 - : 76 - else 77 - echo $1 $2 \"$4\" must match \"$5\" 78 - usage 79 - fi 80 - if echo "$4" | grep -q -e "$6" 81 - then 82 - echo $1 $2 \"$4\" must not match \"$6\" 83 - usage 84 - fi 85 61 } 86 62 87 63 while test $# -gt 0 ··· 146 164 shift 147 165 done 148 166 149 - PATH=${KVM}/bin:$PATH; export PATH 150 167 CONFIGFRAG=${KVM}/configs; export CONFIGFRAG 151 168 KVPATH=${CONFIGFRAG}/$kversion; export KVPATH 152 169