Skip to content

Commit 6be63d7

Browse files
committed
torture: Abstract application of additional Kconfig options
This commit introduces a config_override_param() bash function that folds in an additional set of Kconfig options. This is initially applied to fold in the --kconfig kvm.sh parameter, but later commits will also apply it to the Kconfig options added by the --kcsan kvm.sh parameter. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent b5744d3 commit 6be63d7

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ fi
4545
echo ' ---' `date`: Starting build
4646
echo ' ---' Kconfig fragment at: $config_template >> $resdir/log
4747
touch $resdir/ConfigFragment.input
48+
49+
# Combine additional Kconfig options into an existing set such that newer
50+
# options win. The first argument is the Kconfig source ID, the second
51+
# the source file within $T, the third the destination file within $T,
52+
# and the fourth and final the list of additional Kconfig options.
53+
config_override_param () {
54+
if test -n "$4"
55+
then
56+
echo $4 | sed -e 's/^ *//' -e 's/ *$//' | tr -s " " "\012" > $T/Kconfig_args
57+
echo " --- $1" >> $resdir/ConfigFragment.input
58+
cat $T/Kconfig_args >> $resdir/ConfigFragment.input
59+
config_override.sh $T/$2 $T/Kconfig_args > $T/$3
60+
# Note that "#CHECK#" is not permitted on commandline.
61+
else
62+
cp $T/$2 $T/$3
63+
fi
64+
}
65+
4866
if test -r "$config_dir/CFcommon"
4967
then
5068
echo " --- $config_dir/CFcommon" >> $resdir/ConfigFragment.input
@@ -55,17 +73,8 @@ else
5573
fi
5674
echo " --- $config_template" >> $resdir/ConfigFragment.input
5775
cat $config_template >> $resdir/ConfigFragment.input
58-
if test -n "$TORTURE_KCONFIG_ARG"
59-
then
60-
echo $TORTURE_KCONFIG_ARG | tr -s " " "\012" > $T/cmdline
61-
echo " --- --kconfig argument" >> $resdir/ConfigFragment.input
62-
cat $T/cmdline >> $resdir/ConfigFragment.input
63-
config_override.sh $T/Kc1 $T/cmdline > $T/Kc2
64-
# Note that "#CHECK#" is not permitted on commandline.
65-
else
66-
cp $T/Kc1 $T/Kc2
67-
fi
68-
cat $T/Kc2 > $resdir/ConfigFragment
76+
config_override_param "--kconfig argument" Kc1 Kc2 "$TORTURE_KCONFIG_ARG"
77+
cp $T/Kc2 $resdir/ConfigFragment
6978

7079
base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'`
7180
if test "$base_resdir" != "$resdir" -a -f $base_resdir/bzImage -a -f $base_resdir/vmlinux

0 commit comments

Comments
 (0)