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