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