summaryrefslogtreecommitdiffstats
path: root/test/features/3.7.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/features/3.7.exp')
-rwxr-xr-xtest/features/3.7.exp91
1 files changed, 91 insertions, 0 deletions
diff --git a/test/features/3.7.exp b/test/features/3.7.exp
new file mode 100755
index 000000000..d8236b851
--- /dev/null
+++ b/test/features/3.7.exp
@@ -0,0 +1,91 @@
1#!/usr/bin/expect -f
2#
3# private-tmp
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "touch /tmp/test1\r"
16sleep 1
17send -- "touch /tmp/test2\r"
18sleep 1
19send -- "firejail --noprofile --private-tmp\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "Child process initialized"
23}
24sleep 1
25
26send -- "ls -al /tmp | wc -l\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "3"
30}
31
32
33after 100
34send -- "exit\r"
35sleep 1
36
37#
38# O
39#
40if { $overlay == "overlay" } {
41 send -- "touch /tmp/test1\r"
42 sleep 1
43 send -- "touch /tmp/test2\r"
44 sleep 1
45 send -- "firejail --noprofile --overlay --private-tmp\r"
46 expect {
47 timeout {puts "TESTING ERROR 2\n";exit}
48 "Child process initialized"
49 }
50 sleep 1
51
52 send -- "ls -al /tmp | wc -l\r"
53 expect {
54 timeout {puts "TESTING ERROR 3.1\n";exit}
55 "3"
56 }
57
58
59 after 100
60 send -- "exit\r"
61 sleep 1
62}
63
64#
65# C
66#
67if { $chroot == "chroot" } {
68 send -- "touch /tmp/test1\r"
69 sleep 1
70 send -- "touch /tmp/test2\r"
71 sleep 1
72 send -- "firejail --noprofile --chroot=/tmp/chroot --private-tmp\r"
73 expect {
74 timeout {puts "TESTING ERROR 4\n";exit}
75 "Child process initialized"
76 }
77 sleep 1
78
79 send -- "ls -al /tmp | wc -l\r"
80 expect {
81 timeout {puts "TESTING ERROR 5.1\n";exit}
82 "3"
83 }
84
85 after 100
86 send -- "exit\r"
87 sleep 1
88}
89
90
91puts "\nall done\n"