aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/environment/nice.exp41
-rwxr-xr-xtest/filters/debug.exp45
-rwxr-xr-xtest/filters/filters.sh3
-rwxr-xr-xtest/utils/join.exp8
4 files changed, 97 insertions, 0 deletions
diff --git a/test/environment/nice.exp b/test/environment/nice.exp
index 2c00d1485..50e789c9e 100755
--- a/test/environment/nice.exp
+++ b/test/environment/nice.exp
@@ -77,7 +77,48 @@ expect {
77 "top" 77 "top"
78} 78}
79 79
80sleep 1
81send -- "exit\r"
82after 100
83
84
85# negative nice value should result in nice=0
86send -- "firejail --nice=-5\r"
87expect {
88 timeout {puts "TESTING ERROR 17\n";exit}
89 "Child process initialized"
90}
91sleep 1
92
93send -- "top -b -n 1\r"
94expect {
95 timeout {puts "TESTING ERROR 18\n";exit}
96 $env(USER)
97}
98expect {
99 timeout {puts "TESTING ERROR 19\n";exit}
100 "0"
101}
102expect {
103 timeout {puts "TESTING ERROR 20\n";exit}
104 "bash"
105}
106expect {
107 timeout {puts "TESTING ERROR 21\n";exit}
108 $env(USER)
109}
110expect {
111 timeout {puts "TESTING ERROR 22\n";exit}
112 "0"
113}
114expect {
115 timeout {puts "TESTING ERROR 23\n";exit}
116 "top"
117}
80 118
119sleep 1
120send -- "exit\r"
121after 100
81 122
82puts "\nall done\n" 123puts "\nall done\n"
83 124
diff --git a/test/filters/debug.exp b/test/filters/debug.exp
new file mode 100755
index 000000000..493022c05
--- /dev/null
+++ b/test/filters/debug.exp
@@ -0,0 +1,45 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug-syscalls\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "set_mempolicy"
14}
15after 100
16
17send -- "firejail --debug-syscalls\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "setitimer"
21}
22after 100
23
24send -- "firejail --debug-errnos\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "EBADMSG"
28}
29after 100
30
31send -- "firejail --debug-errnos\r"
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "ELIBMAX"
35}
36after 100
37
38send -- "firejail --debug-protocols\r"
39expect {
40 timeout {puts "TESTING ERROR 4\n";exit}
41 "unix, inet, inet6, netlink, packet"
42}
43after 100
44
45puts "all done\n"
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index 73e0e4d5c..4996e6d66 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -6,6 +6,9 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9echo "TESTING: debug options (test/filters/debug.exp)"
10./debug.exp
11
9echo "TESTING: noroot (test/filters/noroot.exp)" 12echo "TESTING: noroot (test/filters/noroot.exp)"
10./noroot.exp 13./noroot.exp
11 14
diff --git a/test/utils/join.exp b/test/utils/join.exp
index b74b0b17a..d5c421676 100755
--- a/test/utils/join.exp
+++ b/test/utils/join.exp
@@ -16,6 +16,14 @@ expect {
16sleep 2 16sleep 2
17 17
18spawn $env(SHELL) 18spawn $env(SHELL)
19send -- "firejail --shell=none --join=jointesting\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "shell=none set, but no command specified"
23}
24after 100
25
26
19send -- "firejail --join=jointesting\r" 27send -- "firejail --join=jointesting\r"
20expect { 28expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 29 timeout {puts "TESTING ERROR 1\n";exit}