diff options
Diffstat (limited to 'test/utils/shutdown.exp')
-rwxr-xr-x | test/utils/shutdown.exp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp new file mode 100755 index 000000000..1ab231bf4 --- /dev/null +++ b/test/utils/shutdown.exp | |||
@@ -0,0 +1,49 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --name=shutdowntesting\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 2 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --shutdown=shutdowntesting; echo done\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 4\n";exit} | ||
22 | "done" | ||
23 | } | ||
24 | sleep 5 | ||
25 | |||
26 | spawn $env(SHELL) | ||
27 | send -- "firejail --list;echo done\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 5\n";exit} | ||
30 | "shutdowntesting" {puts "TESTING ERROR 6\n";exit} | ||
31 | "done" | ||
32 | } | ||
33 | sleep 1 | ||
34 | |||
35 | send -- "firejail --shutdown=sutdowntesting\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 5\n";exit} | ||
38 | "cannot find sandbox sutdowntesting" | ||
39 | } | ||
40 | after 100 | ||
41 | |||
42 | send -- "firejail --shutdown=10\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5\n";exit} | ||
45 | "this is not a firejail sandbox" | ||
46 | } | ||
47 | after 100 | ||
48 | |||
49 | puts "\nall done\n" | ||