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