diff options
author | netblue30 <netblue30@yahoo.com> | 2017-03-04 14:47:47 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-03-04 14:47:47 -0500 |
commit | 76fcd85a1f441de1192194fcb712c35b7d985b69 (patch) | |
tree | 5fab3a982cb12d9891c06e2a462d3c71887c6416 /test | |
parent | fix and document firemon --nowrap (diff) | |
download | firejail-76fcd85a1f441de1192194fcb712c35b7d985b69.tar.gz firejail-76fcd85a1f441de1192194fcb712c35b7d985b69.tar.zst firejail-76fcd85a1f441de1192194fcb712c35b7d985b69.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/environment/nice.exp | 41 | ||||
-rwxr-xr-x | test/filters/debug.exp | 45 | ||||
-rwxr-xr-x | test/filters/filters.sh | 3 | ||||
-rwxr-xr-x | test/utils/join.exp | 8 |
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 | ||
80 | sleep 1 | ||
81 | send -- "exit\r" | ||
82 | after 100 | ||
83 | |||
84 | |||
85 | # negative nice value should result in nice=0 | ||
86 | send -- "firejail --nice=-5\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 17\n";exit} | ||
89 | "Child process initialized" | ||
90 | } | ||
91 | sleep 1 | ||
92 | |||
93 | send -- "top -b -n 1\r" | ||
94 | expect { | ||
95 | timeout {puts "TESTING ERROR 18\n";exit} | ||
96 | $env(USER) | ||
97 | } | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 19\n";exit} | ||
100 | "0" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 20\n";exit} | ||
104 | "bash" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 21\n";exit} | ||
108 | $env(USER) | ||
109 | } | ||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 22\n";exit} | ||
112 | "0" | ||
113 | } | ||
114 | expect { | ||
115 | timeout {puts "TESTING ERROR 23\n";exit} | ||
116 | "top" | ||
117 | } | ||
80 | 118 | ||
119 | sleep 1 | ||
120 | send -- "exit\r" | ||
121 | after 100 | ||
81 | 122 | ||
82 | puts "\nall done\n" | 123 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --debug-syscalls\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "set_mempolicy" | ||
14 | } | ||
15 | after 100 | ||
16 | |||
17 | send -- "firejail --debug-syscalls\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "setitimer" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "firejail --debug-errnos\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "EBADMSG" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "firejail --debug-errnos\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3\n";exit} | ||
34 | "ELIBMAX" | ||
35 | } | ||
36 | after 100 | ||
37 | |||
38 | send -- "firejail --debug-protocols\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "unix, inet, inet6, netlink, packet" | ||
42 | } | ||
43 | after 100 | ||
44 | |||
45 | puts "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 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | echo "TESTING: debug options (test/filters/debug.exp)" | ||
10 | ./debug.exp | ||
11 | |||
9 | echo "TESTING: noroot (test/filters/noroot.exp)" | 12 | echo "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 { | |||
16 | sleep 2 | 16 | sleep 2 |
17 | 17 | ||
18 | spawn $env(SHELL) | 18 | spawn $env(SHELL) |
19 | send -- "firejail --shell=none --join=jointesting\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "shell=none set, but no command specified" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | |||
19 | send -- "firejail --join=jointesting\r" | 27 | send -- "firejail --join=jointesting\r" |
20 | expect { | 28 | expect { |
21 | timeout {puts "TESTING ERROR 1\n";exit} | 29 | timeout {puts "TESTING ERROR 1\n";exit} |