Improve coverage of the functional test a bit
[kconfig-hardened-check.git] / .github / workflows / functional_test.sh
index a4fb08597e7141b9f23f3c3ad22fd222a1fca95a..89b5c77d49890e7f48dd01fac7f081fedf2fd963 100644 (file)
@@ -3,6 +3,9 @@
 set -x
 set -e
 
+git status
+git show -s
+
 echo "Beginning of the functional tests"
 
 echo ">>>>> get help <<<<<"
@@ -37,7 +40,7 @@ coverage run -a --branch bin/kconfig-hardened-check -g ARM
 
 echo ">>>>> check the example kconfig files, cmdline, and sysctl <<<<<"
 cat /proc/cmdline
-echo "l1tf=off mds=full randomize_kstack_offset=on iommu.passthrough=0" > ./cmdline_example
+echo "l1tf=off mds=full mitigations=off randomize_kstack_offset=on retbleed=0 iommu.passthrough=0" > ./cmdline_example
 cat ./cmdline_example
 sysctl -a > /tmp/sysctls
 CONFIG_DIR=`find . -name config_files`
@@ -125,4 +128,13 @@ echo 'hey man 1' > cmdline
 echo 'hey man 2' >> cmdline
 coverage run -a --branch bin/kconfig-hardened-check -c test.config -l cmdline && exit 1
 
+echo ">>>>> unexpected line in the sysctl file <<<<<"
+cp $SYSCTL_EXAMPLE error_sysctls
+echo 'some strange line' >> error_sysctls
+coverage run -a --branch bin/kconfig-hardened-check -c test.config -s error_sysctls && exit 1
+
+echo ">>>>> invalid sysctl file <<<<<"
+touch empty_file
+coverage run -a --branch bin/kconfig-hardened-check -c test.config -s empty_file && exit 1
+
 echo "The end of the functional tests"