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