summaryrefslogtreecommitdiffstats
path: root/tools/bootconfig
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-06-16 19:14:34 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-06-16 21:21:03 -0400
commit5414251aa2e23ad50cc769656b05ea196090e792 (patch)
tree07909bab9064c2c230158557b901b29b15e156ca /tools/bootconfig
parentf91cb5b7476a603068eae31e5b2cc170dd2b9b1b (diff)
downloadlinux-stable-5414251aa2e23ad50cc769656b05ea196090e792.tar.gz
linux-stable-5414251aa2e23ad50cc769656b05ea196090e792.tar.bz2
linux-stable-5414251aa2e23ad50cc769656b05ea196090e792.zip
tools/bootconfig: Add testcase for show-command and quotes test
Add testcases for the return value of the command to show bootconfig in initrd, and double/single quotes selecting. Link: http://lkml.kernel.org/r/159230247428.65555.2109472942519215104.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/bootconfig')
-rwxr-xr-xtools/bootconfig/test-bootconfig.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh
index eff16b77d5eb..3c2ab9e75730 100755
--- a/tools/bootconfig/test-bootconfig.sh
+++ b/tools/bootconfig/test-bootconfig.sh
@@ -55,6 +55,9 @@ echo "Apply command test"
xpass $BOOTCONF -a $TEMPCONF $INITRD
new_size=$(stat -c %s $INITRD)
+echo "Show command test"
+xpass $BOOTCONF $INITRD
+
echo "File size check"
xpass test $new_size -eq $(expr $bconf_size + $initrd_size + 9 + 12)
@@ -114,6 +117,13 @@ xpass grep -q "bar" $OUTFILE
xpass grep -q "baz" $OUTFILE
xpass grep -q "qux" $OUTFILE
+echo "Double/single quotes test"
+echo "key = '\"string\"';" > $TEMPCONF
+$BOOTCONF -a $TEMPCONF $INITRD
+$BOOTCONF $INITRD > $TEMPCONF
+cat $TEMPCONF
+xpass grep \'\"string\"\' $TEMPCONF
+
echo "=== expected failure cases ==="
for i in samples/bad-* ; do
xfail $BOOTCONF -a $i $INITRD