diff options
Diffstat (limited to 'test/seccomp-extra/protocol-print.exp')
-rwxr-xr-x | test/seccomp-extra/protocol-print.exp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/seccomp-extra/protocol-print.exp b/test/seccomp-extra/protocol-print.exp new file mode 100755 index 000000000..7e76e6ff6 --- /dev/null +++ b/test/seccomp-extra/protocol-print.exp | |||
@@ -0,0 +1,59 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=test0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --name=test1 --profile=protocol1.profile\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
23 | } | ||
24 | sleep 2 | ||
25 | |||
26 | spawn $env(SHELL) | ||
27 | send -- "firejail --name=test2 --profile=protocol2.profile\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 2\n";exit} | ||
30 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
31 | } | ||
32 | sleep 2 | ||
33 | |||
34 | spawn $env(SHELL) | ||
35 | send -- "firejail --protocol.print=test0\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 3\n";exit} | ||
38 | "packet" {puts "TESTING ERROR 4\n";exit} | ||
39 | "unix,inet,inet6" | ||
40 | } | ||
41 | after 500 | ||
42 | |||
43 | send -- "firejail --protocol.print=test1\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 5\n";exit} | ||
46 | "inet" {puts "TESTING ERROR 6\n";exit} | ||
47 | "unix" | ||
48 | } | ||
49 | after 500 | ||
50 | |||
51 | send -- "firejail --protocol.print=test2\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 7\n";exit} | ||
54 | "unix" {puts "TESTING ERROR 8\n";exit} | ||
55 | "inet6,packet" | ||
56 | } | ||
57 | after 500 | ||
58 | |||
59 | puts "\nall done\n" | ||