diff options
Diffstat (limited to 'test/utils/trace.exp')
-rwxr-xr-x | test/utils/trace.exp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/test/utils/trace.exp b/test/utils/trace.exp new file mode 100755 index 000000000..21dd6a559 --- /dev/null +++ b/test/utils/trace.exp | |||
@@ -0,0 +1,94 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 30 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --trace mkdir ttt\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "mkdir:mkdir ttt" | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "firejail --trace rmdir ttt\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "Child process initialized" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | "rmdir:rmdir ttt" | ||
26 | } | ||
27 | sleep 1 | ||
28 | |||
29 | send -- "firejail --trace touch ttt\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "Child process initialized" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 5\n";exit} | ||
36 | "touch:open ttt" {puts "OK\n";} | ||
37 | "touch:open64 ttt" {puts "OK\n";} | ||
38 | } | ||
39 | sleep 1 | ||
40 | |||
41 | send -- "firejail --trace rm ttt\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 6\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 7\n";exit} | ||
48 | "rm:unlinkat ttt" | ||
49 | } | ||
50 | sleep 1 | ||
51 | |||
52 | send -- "firejail --trace wget -q debian.org\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 8.1\n";exit} | ||
55 | "Child process initialized" | ||
56 | } | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 8.2\n";exit} | ||
59 | "bash:open /dev/tty" {puts "OK\n";} | ||
60 | "bash:open64 /dev/tty" {puts "OK\n";} | ||
61 | } | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 8.3\n";exit} | ||
64 | "wget:fopen64 /etc/wgetrc" {puts "OK\n";} | ||
65 | "wget:fopen /etc/wgetrc" {puts "OK\n";} | ||
66 | } | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 8.4\n";exit} | ||
69 | "wget:fopen /etc/hosts" | ||
70 | } | ||
71 | expect { | ||
72 | timeout {puts "TESTING ERROR 8.5\n";exit} | ||
73 | "wget:connect" | ||
74 | } | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 8.6\n";exit} | ||
77 | "wget:fopen64 index.html" {puts "OK\n";} | ||
78 | "wget:fopen index.html" {puts "OK\n";} | ||
79 | } | ||
80 | sleep 1 | ||
81 | |||
82 | send -- "firejail --trace rm index.html\r" | ||
83 | expect { | ||
84 | timeout {puts "TESTING ERROR 9\n";exit} | ||
85 | "Child process initialized" | ||
86 | } | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 10\n";exit} | ||
89 | "rm:unlinkat index.html" | ||
90 | } | ||
91 | sleep 1 | ||
92 | |||
93 | |||
94 | puts "\nall done\n" | ||