From c5bf4c3512a0a582310529ec5217b892bef42d15 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 23 Jan 2016 10:30:56 -0500 Subject: kmsg testing --- test/kmsg.exp | 29 +++++++++++++++++++++++++++++ test/test.sh | 3 +++ 2 files changed, 32 insertions(+) create mode 100755 test/kmsg.exp diff --git a/test/kmsg.exp b/test/kmsg.exp new file mode 100755 index 000000000..096bdb708 --- /dev/null +++ b/test/kmsg.exp @@ -0,0 +1,29 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "cat /dev/kmsg\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Permission denied" +} +sleep 1 + +send -- "cat /proc/kmsg\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Permission denied" +} +sleep 1 + +puts "\nall done\n" + diff --git a/test/test.sh b/test/test.sh index 44bb7ba99..2c051d13b 100755 --- a/test/test.sh +++ b/test/test.sh @@ -86,6 +86,9 @@ rm -f index.html* echo "TESTING: extract command" ./extract_command.exp +echo "TESTING: kmsg access" +./kmsg.exp + echo "TESTING: rlimit" ./option_rlimit.exp -- cgit v1.2.3-70-g09d2