summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Brown <david.brown@linaro.org>2016-01-14 10:38:58 -0700
committerDavid Brown <david.brown@linaro.org>2016-01-14 10:38:58 -0700
commit431f9216aa098eb887d548d07773ed9f2bdae01c (patch)
treecd37a0a0e8a4bb4096674f237e610227c042c0d9
parentc81ae13e24c200ddd848a1713efe91c6ac82c3b0 (diff)
Test results of uderef test
-rwxr-xr-xcheck-uderef.sh10
-rwxr-xr-xtest-uderef.sh15
-rw-r--r--uderef.yaml1
3 files changed, 22 insertions, 4 deletions
diff --git a/check-uderef.sh b/check-uderef.sh
new file mode 100755
index 0000000..2cd51b7
--- /dev/null
+++ b/check-uderef.sh
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+# If the marker is still present, it suggests that the UDEREF check
+# killed the running shell, and we should consider this a pass.
+if [ -f /tmp/uderef-6256ff7e ]; then
+ echo "UDEREF appears to have been detected"
+ echo "test: uderef: pass"
+
+ rm /tmp/uderef-6256ff7e
+fi
diff --git a/test-uderef.sh b/test-uderef.sh
index e1afb88..19df2ed 100755
--- a/test-uderef.sh
+++ b/test-uderef.sh
@@ -8,11 +8,18 @@ pwd
# If the feature is not compiled into the kernel, fail right away.
if [ ! -f /sys/kernel/debug/provoke-crash/DIRECT ]; then
- echo "Kernel was not compiled with ????"
+ echo "Kernel was not compiled with CONFIG_LKDTM"
echo "Not possible to test for UDEREF, failing"
echo "test: uderef: fail"
-else
- echo "pass for now:"
- echo "test: uderef: pass"
fi
+# Put a marker file that we can check later.
+touch /tmp/uderef-6256ff7e
+
+cat /sys/kernel/debug/provoke-crash/DIRECT
+
+# If we got this far, we were not killed by the UDEREF blocks in the
+# kernel, which means we should go ahead and fail.
+rm /tmp/uderef-6256ff7e
+echo "Shell was not killed by uderef"
+echo "test: uderef: fail"
diff --git a/uderef.yaml b/uderef.yaml
index 13ba28c..3e800fa 100644
--- a/uderef.yaml
+++ b/uderef.yaml
@@ -13,6 +13,7 @@ run:
steps:
- "pwd"
- "./test-uderef.sh"
+ - "./check-uderef.sh"
parse:
pattern: "^test:\\s(?P<test_case_id>[a-zA-Z0-9_-]+):\\s(?P<result>\\w+)"