diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-10 20:15:22 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-10 20:15:22 -0500 |
commit | fffce11c3da087172c069ec0ff4c788f5bcc522b (patch) | |
tree | 7e3297f56448ebc8122f8fbb006fa3ce034ea62c /test/root/firemon-events.exp | |
parent | testing (diff) | |
download | firejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.tar.gz firejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.tar.zst firejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.zip |
testing
Diffstat (limited to 'test/root/firemon-events.exp')
-rwxr-xr-x | test/root/firemon-events.exp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/root/firemon-events.exp b/test/root/firemon-events.exp new file mode 100755 index 000000000..4f305e51d --- /dev/null +++ b/test/root/firemon-events.exp | |||
@@ -0,0 +1,72 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # start firemon | ||
8 | set firemon_id $spawn_id | ||
9 | send -- "firemon\r" | ||
10 | sleep 1 | ||
11 | |||
12 | # start firejail | ||
13 | spawn $env(SHELL) | ||
14 | set firejail_id $spawn_id | ||
15 | send -- "firejail\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0\n";exit} | ||
18 | "Child process initialized" | ||
19 | } | ||
20 | |||
21 | # get messages on firemon | ||
22 | set spawn_id $firemon_id | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 1\n";exit} | ||
25 | "exec" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "/bin/bash -c /bin/bash" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "exec" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 4\n";exit} | ||
37 | "/bin/bash" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5\n";exit} | ||
41 | "fork" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 6\n";exit} | ||
45 | "child" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 7\n";exit} | ||
49 | "/bin/bash" | ||
50 | } | ||
51 | after 100 | ||
52 | |||
53 | # exit firejail | ||
54 | set spawn_id $firejail_id | ||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | |||
58 | # get messages on firemon | ||
59 | set spawn_id $firemon_id | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 8\n";exit} | ||
62 | "exit" | ||
63 | } | ||
64 | |||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 9\n";exit} | ||
67 | "EXIT SANDBOX" | ||
68 | } | ||
69 | |||
70 | |||
71 | puts "\nall done\n" | ||
72 | |||