diff options
Diffstat (limited to 'test/features/3.1.exp')
-rwxr-xr-x | test/features/3.1.exp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/features/3.1.exp b/test/features/3.1.exp new file mode 100755 index 000000000..6abbf94a5 --- /dev/null +++ b/test/features/3.1.exp | |||
@@ -0,0 +1,72 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # tmpfs | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "touch ~/.config/firejail-test-file\r" | ||
14 | sleep 1 | ||
15 | send -- "firejail --noprofile --tmpfs=/home/netblue/.config\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0\n";exit} | ||
18 | "Child process initialized" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | send -- "ls ~/.config | wc -l\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 1\n";exit} | ||
25 | "0" | ||
26 | } | ||
27 | after 100 | ||
28 | send -- "exit\r" | ||
29 | sleep 1 | ||
30 | |||
31 | # | ||
32 | # O | ||
33 | # | ||
34 | send -- "firejail --noprofile --overlay --tmpfs=/home/netblue/.config\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 2\n";exit} | ||
37 | "Child process initialized" | ||
38 | } | ||
39 | sleep 1 | ||
40 | |||
41 | send -- "ls ~/.config | wc -l\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "0" | ||
45 | } | ||
46 | after 100 | ||
47 | send -- "exit\r" | ||
48 | sleep 1 | ||
49 | |||
50 | # | ||
51 | # C | ||
52 | # | ||
53 | send -- "touch /tmp/chroot/home/netblue/.config/firejail-test-file\r" | ||
54 | sleep 1 | ||
55 | send -- "firejail --noprofile --chroot=/tmp/chroot --tmpfs=/home/netblue/.config\r" | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 4\n";exit} | ||
58 | "Child process initialized" | ||
59 | } | ||
60 | sleep 1 | ||
61 | |||
62 | send -- "ls ~/.config | wc -l\r" | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 5\n";exit} | ||
65 | "0" | ||
66 | } | ||
67 | after 100 | ||
68 | send -- "exit\r" | ||
69 | sleep 1 | ||
70 | |||
71 | |||
72 | puts "\nall done\n" | ||