summaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 06:37:12 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 06:37:12 -0400
commit1724b3bd7fd86876b244cbaf3e4e3a1d005b843d (patch)
tree2831e73514aa7bc67478be0f63e7d22f7c73218f /test/utils
parenttesting (diff)
downloadfirejail-1724b3bd7fd86876b244cbaf3e4e3a1d005b843d.tar.gz
firejail-1724b3bd7fd86876b244cbaf3e4e3a1d005b843d.tar.zst
firejail-1724b3bd7fd86876b244cbaf3e4e3a1d005b843d.zip
testing
Diffstat (limited to 'test/utils')
-rwxr-xr-xtest/utils/trace.exp94
-rwxr-xr-xtest/utils/trace2.exp25
2 files changed, 119 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
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 "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 "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 "touch:open ttt" {puts "OK\n";}
37 "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 "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 "bash:open /dev/tty" {puts "OK\n";}
60 "bash:open64 /dev/tty" {puts "OK\n";}
61}
62expect {
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}
67expect {
68 timeout {puts "TESTING ERROR 8.4\n";exit}
69 "wget:fopen /etc/hosts"
70}
71expect {
72 timeout {puts "TESTING ERROR 8.5\n";exit}
73 "wget:connect"
74}
75expect {
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}
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 "rm:unlinkat index.html"
90}
91sleep 1
92
93
94puts "\nall done\n"
diff --git a/test/utils/trace2.exp b/test/utils/trace2.exp
new file mode 100755
index 000000000..38038b58e
--- /dev/null
+++ b/test/utils/trace2.exp
@@ -0,0 +1,25 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --trace\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 "bash:open /dev/tty" {puts "64bit\n"}
15 "bash:open64 /dev/tty" {puts "32bit\n"}
16}
17expect {
18 timeout {puts "TESTING ERROR 3\n";exit}
19 "bash:access /etc/terminfo/x/xterm" {puts "debian\n"}
20 "bash:access /usr/share/terminfo/x/xterm" {puts "arch\n"}
21}
22
23sleep 1
24
25puts "\nall done\n"