diff options
Diffstat (limited to 'test/appimage/appimage-v1.exp')
-rwxr-xr-x | test/appimage/appimage-v1.exp | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp new file mode 100755 index 000000000..f1c1c10f5 --- /dev/null +++ b/test/appimage/appimage-v1.exp | |||
@@ -0,0 +1,85 @@ | |||
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 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --list\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | ":firejail" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
25 | "appimage Leafpad" | ||
26 | } | ||
27 | after 100 | ||
28 | |||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
33 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
34 | "cannot open" {puts "grsecurity not present\n"} | ||
35 | } | ||
36 | |||
37 | |||
38 | send -- "firejail --name=blablabla\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "Child process initialized" | ||
42 | } | ||
43 | sleep 2 | ||
44 | |||
45 | spawn $env(SHELL) | ||
46 | send -- "firemon --seccomp\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5\n";exit} | ||
49 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
50 | "appimage Leafpad" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
54 | "Seccomp: 2" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
58 | "name=blablabla" | ||
59 | } | ||
60 | after 100 | ||
61 | send -- "firemon --caps\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 6\n";exit} | ||
64 | "appimage Leafpad" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
68 | "CapBnd:" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
72 | "0000000000000000" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
76 | "name=blablabla" | ||
77 | } | ||
78 | after 100 | ||
79 | |||
80 | spawn $env(SHELL) | ||
81 | send -- "firejail --shutdown=appimage-test\r" | ||
82 | sleep 3 | ||
83 | |||
84 | puts "\nall done\n" | ||
85 | |||