diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-13 10:47:20 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-13 10:47:20 -0500 |
commit | 63e16bfcd9f79c63f3801f51df4840f74fa6f41b (patch) | |
tree | fa62784ad7ff5becbb4856ed84264cb5d4de8828 /test/utils | |
parent | set_perms cleanup (diff) | |
download | firejail-63e16bfcd9f79c63f3801f51df4840f74fa6f41b.tar.gz firejail-63e16bfcd9f79c63f3801f51df4840f74fa6f41b.tar.zst firejail-63e16bfcd9f79c63f3801f51df4840f74fa6f41b.zip |
major cleanup and testing
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/join.exp | 2 | ||||
-rwxr-xr-x | test/utils/ls.exp | 42 | ||||
-rwxr-xr-x | test/utils/utils.sh | 4 |
3 files changed, 40 insertions, 8 deletions
diff --git a/test/utils/join.exp b/test/utils/join.exp index 7f582e2e5..fc30bc6a4 100755 --- a/test/utils/join.exp +++ b/test/utils/join.exp | |||
@@ -8,7 +8,7 @@ cd /home | |||
8 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
9 | match_max 100000 | 9 | match_max 100000 |
10 | 10 | ||
11 | send -- "firejail --name=jointesting\r" | 11 | send -- "firejail --name=jointesting --cpu=0 --nice=2\r" |
12 | expect { | 12 | expect { |
13 | timeout {puts "TESTING ERROR 0\n";exit} | 13 | timeout {puts "TESTING ERROR 0\n";exit} |
14 | "Child process initialized" | 14 | "Child process initialized" |
diff --git a/test/utils/ls.exp b/test/utils/ls.exp index cd2c2984c..ff6867c51 100755 --- a/test/utils/ls.exp +++ b/test/utils/ls.exp | |||
@@ -3,6 +3,8 @@ | |||
3 | set timeout 10 | 3 | set timeout 10 |
4 | spawn $env(SHELL) | 4 | spawn $env(SHELL) |
5 | match_max 100000 | 5 | match_max 100000 |
6 | set firstspawn $spawn_id | ||
7 | |||
6 | 8 | ||
7 | send -- "rm -f lstesting\r" | 9 | send -- "rm -f lstesting\r" |
8 | sleep 1 | 10 | sleep 1 |
@@ -11,11 +13,11 @@ expect { | |||
11 | timeout {puts "TESTING ERROR 0\n";exit} | 13 | timeout {puts "TESTING ERROR 0\n";exit} |
12 | "Child process initialized" | 14 | "Child process initialized" |
13 | } | 15 | } |
14 | sleep 2 | 16 | sleep 1 |
15 | send -- "echo my_testing > ~/lstesting\r" | 17 | send -- "echo my_testing > ~/lstesting\r" |
16 | sleep 2 | 18 | after 100 |
17 | |||
18 | 19 | ||
20 | # ls | ||
19 | spawn $env(SHELL) | 21 | spawn $env(SHELL) |
20 | send -- "firejail --ls=test ~/.\r" | 22 | send -- "firejail --ls=test ~/.\r" |
21 | expect { | 23 | expect { |
@@ -23,14 +25,44 @@ expect { | |||
23 | "lstesting" | 25 | "lstesting" |
24 | } | 26 | } |
25 | sleep 1 | 27 | sleep 1 |
28 | |||
29 | # get | ||
26 | send -- "firejail --get=test ~/lstesting\r" | 30 | send -- "firejail --get=test ~/lstesting\r" |
27 | sleep 2 | 31 | sleep 1 |
28 | send -- "cat lstesting\r" | 32 | send -- "cat lstesting\r" |
29 | expect { | 33 | expect { |
30 | timeout {puts "TESTING ERROR 3\n";exit} | 34 | timeout {puts "TESTING ERROR 2n";exit} |
31 | "my_testing" | 35 | "my_testing" |
32 | } | 36 | } |
37 | after 100 | ||
38 | |||
39 | # put | ||
40 | send -- "echo put_test > ~/lstesting\r" | ||
41 | after 100 | ||
42 | send -- "firejail --put=test ~/lstesting ~/lstesting_2\r" | ||
33 | sleep 1 | 43 | sleep 1 |
44 | |||
45 | set spawn_id $firstspawn | ||
46 | send -- "ls -al ~\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 3\n";exit} | ||
49 | "lstesting_2" | ||
50 | } | ||
51 | |||
52 | after 100 | ||
53 | send -- "cat ~/lstesting_2\r" | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 4\n";exit} | ||
56 | "put_test" | ||
57 | } | ||
58 | after 100 | ||
59 | send -- "exit\r" | ||
60 | sleep 1 | ||
61 | |||
62 | |||
63 | |||
64 | |||
65 | |||
34 | send -- "rm -f lstesting\r" | 66 | send -- "rm -f lstesting\r" |
35 | 67 | ||
36 | after 100 | 68 | after 100 |
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 7b0ab1096..bd91110f7 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -88,10 +88,10 @@ echo "TESTING: top (test/utils/top.exp)" | |||
88 | echo "TESTING: file transfer (test/utils/ls.exp)" | 88 | echo "TESTING: file transfer (test/utils/ls.exp)" |
89 | ./ls.exp | 89 | ./ls.exp |
90 | 90 | ||
91 | echo "TESTING: firemon --seccomp (test/utils/firemon-seccomp.exp)" | 91 | echo "TESTING: firemon seccomp (test/utils/firemon-seccomp.exp)" |
92 | ./firemon-seccomp.exp | 92 | ./firemon-seccomp.exp |
93 | 93 | ||
94 | echo "TESTING: firemon --caps (test/utils/firemon-caps.exp)" | 94 | echo "TESTING: firemon caps (test/utils/firemon-caps.exp)" |
95 | ./firemon-caps.exp | 95 | ./firemon-caps.exp |
96 | 96 | ||
97 | echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" | 97 | echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" |