From 8fdc4029ad9bd2489aa0266bbbcaefac4fb239d1 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 11 Feb 2016 09:03:35 -0500 Subject: set sandbox nice value --- test/nice.exp | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/nice.profile | 1 + test/test.sh | 3 +++ 3 files changed, 84 insertions(+) create mode 100755 test/nice.exp create mode 100644 test/nice.profile (limited to 'test') diff --git a/test/nice.exp b/test/nice.exp new file mode 100755 index 000000000..f4afb547d --- /dev/null +++ b/test/nice.exp @@ -0,0 +1,80 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --nice=15\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "top -b -n 1\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "netblue" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "bash" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "netblu" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "top" +} + +sleep 1 +send -- "exit\r" +sleep 1 + +send -- "firejail --profile=nice.profile\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "top -b -n 1\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "netblue" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "bash" +} +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "netblu" +} +expect { + timeout {puts "TESTING ERROR 15\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 16\n";exit} + "top" +} + + + +puts "\nall done\n" + diff --git a/test/nice.profile b/test/nice.profile new file mode 100644 index 000000000..d02c8f58b --- /dev/null +++ b/test/nice.profile @@ -0,0 +1 @@ +nice 15 diff --git a/test/test.sh b/test/test.sh index ca7152b55..923a9b390 100755 --- a/test/test.sh +++ b/test/test.sh @@ -6,6 +6,9 @@ ./fscheck.sh +echo "TESTING: nice" +./nice.exp + echo "TESTING: protocol" ./protocol.exp -- cgit v1.2.3-54-g00ecf