aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-22 15:14:13 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-22 15:14:13 -0500
commita989aac28eb0c28d09aa3ee72d9d67e168686f78 (patch)
tree60c71af1fabeb04af21a19784c614c37dc665c6e /test/features
parentfeature testing (diff)
downloadfirejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.tar.gz
firejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.tar.zst
firejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.zip
feature testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/1.10.exp69
-rwxr-xr-xtest/features/1.4.exp106
2 files changed, 175 insertions, 0 deletions
diff --git a/test/features/1.10.exp b/test/features/1.10.exp
new file mode 100755
index 000000000..a6e0f9281
--- /dev/null
+++ b/test/features/1.10.exp
@@ -0,0 +1,69 @@
1#!/usr/bin/expect -f
2#
3# disable /selinux
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10#
11# N
12#
13send -- "firejail --noprofile\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "ls -l /selinux\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "Permission denied"
24}
25after 100
26send -- "exit\r"
27sleep 1
28
29
30#
31# O
32#
33send -- "firejail --noprofile --overlay\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 "Child process initialized"
37}
38sleep 1
39
40send -- "ls -l /selinux\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "Permission denied"
44}
45after 100
46send -- "exit\r"
47sleep 1
48
49#
50# C
51#
52send -- "firejail --noprofile --chroot=/tmp/chroot\r"
53expect {
54 timeout {puts "TESTING ERROR 4\n";exit}
55 "Child process initialized"
56}
57sleep 1
58
59send -- "ls -l /selinux\r"
60expect {
61 timeout {puts "TESTING ERROR 5\n";exit}
62 "Permission denied"
63}
64after 100
65send -- "exit\r"
66sleep 1
67
68
69puts "\nall done\n"
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
new file mode 100755
index 000000000..82d683175
--- /dev/null
+++ b/test/features/1.4.exp
@@ -0,0 +1,106 @@
1#!/usr/bin/expect -f
2#
3# mask other users
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10#
11# N
12#
13send -- "firejail --noprofile\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "ls -l /home | wc -l\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "2"
24}
25after 100
26send -- "cat /etc/passwd | grep 1001 | wc -l\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "0"
30}
31after 100
32send -- "cat /etc/group | grep 1001 | wc -l\r"
33expect {
34 timeout {puts "TESTING ERROR 1.2\n";exit}
35 "0"
36}
37after 100
38
39send -- "exit\r"
40sleep 1
41
42
43#
44# O
45#
46send -- "firejail --noprofile --overlay\r"
47expect {
48 timeout {puts "TESTING ERROR 2\n";exit}
49 "Child process initialized"
50}
51sleep 1
52
53send -- "ls -l /home | wc -l\r"
54expect {
55 timeout {puts "TESTING ERROR 3\n";exit}
56 "2"
57}
58after 100
59send -- "cat /etc/passwd | grep 1001 | wc -l\r"
60expect {
61 timeout {puts "TESTING ERROR 3.1\n";exit}
62 "0"
63}
64after 100
65send -- "cat /etc/group | grep 1001 | wc -l\r"
66expect {
67 timeout {puts "TESTING ERROR 3.2\n";exit}
68 "0"
69}
70after 100
71send -- "exit\r"
72sleep 1
73
74#
75# C
76#
77send -- "firejail --noprofile --chroot=/tmp/chroot\r"
78expect {
79 timeout {puts "TESTING ERROR 4\n";exit}
80 "Child process initialized"
81}
82sleep 1
83
84send -- "ls -l /home | wc -l\r"
85expect {
86 timeout {puts "TESTING ERROR 5\n";exit}
87 "2"
88}
89after 100
90send -- "cat /etc/passwd | grep 1001 | wc -l\r"
91expect {
92 timeout {puts "TESTING ERROR 5.1\n";exit}
93 "0"
94}
95after 100
96send -- "cat /etc/group | grep 1001 | wc -l\r"
97expect {
98 timeout {puts "TESTING ERROR 5.2\n";exit}
99 "0"
100}
101after 100
102send -- "exit\r"
103sleep 1
104
105
106puts "\nall done\n"