diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-22 15:14:13 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-22 15:14:13 -0500 |
commit | a989aac28eb0c28d09aa3ee72d9d67e168686f78 (patch) | |
tree | 60c71af1fabeb04af21a19784c614c37dc665c6e | |
parent | feature testing (diff) | |
download | firejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.tar.gz firejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.tar.zst firejail-a989aac28eb0c28d09aa3ee72d9d67e168686f78.zip |
feature testing
-rwxr-xr-x | test/features/1.10.exp | 69 | ||||
-rwxr-xr-x | test/features/1.4.exp | 106 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "firejail --noprofile\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "ls -l /selinux\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "Permission denied" | ||
24 | } | ||
25 | after 100 | ||
26 | send -- "exit\r" | ||
27 | sleep 1 | ||
28 | |||
29 | |||
30 | # | ||
31 | # O | ||
32 | # | ||
33 | send -- "firejail --noprofile --overlay\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 2\n";exit} | ||
36 | "Child process initialized" | ||
37 | } | ||
38 | sleep 1 | ||
39 | |||
40 | send -- "ls -l /selinux\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3\n";exit} | ||
43 | "Permission denied" | ||
44 | } | ||
45 | after 100 | ||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | |||
49 | # | ||
50 | # C | ||
51 | # | ||
52 | send -- "firejail --noprofile --chroot=/tmp/chroot\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 4\n";exit} | ||
55 | "Child process initialized" | ||
56 | } | ||
57 | sleep 1 | ||
58 | |||
59 | send -- "ls -l /selinux\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 5\n";exit} | ||
62 | "Permission denied" | ||
63 | } | ||
64 | after 100 | ||
65 | send -- "exit\r" | ||
66 | sleep 1 | ||
67 | |||
68 | |||
69 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "firejail --noprofile\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "ls -l /home | wc -l\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "2" | ||
24 | } | ||
25 | after 100 | ||
26 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
29 | "0" | ||
30 | } | ||
31 | after 100 | ||
32 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
35 | "0" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "exit\r" | ||
40 | sleep 1 | ||
41 | |||
42 | |||
43 | # | ||
44 | # O | ||
45 | # | ||
46 | send -- "firejail --noprofile --overlay\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 2\n";exit} | ||
49 | "Child process initialized" | ||
50 | } | ||
51 | sleep 1 | ||
52 | |||
53 | send -- "ls -l /home | wc -l\r" | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 3\n";exit} | ||
56 | "2" | ||
57 | } | ||
58 | after 100 | ||
59 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
62 | "0" | ||
63 | } | ||
64 | after 100 | ||
65 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
68 | "0" | ||
69 | } | ||
70 | after 100 | ||
71 | send -- "exit\r" | ||
72 | sleep 1 | ||
73 | |||
74 | # | ||
75 | # C | ||
76 | # | ||
77 | send -- "firejail --noprofile --chroot=/tmp/chroot\r" | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 4\n";exit} | ||
80 | "Child process initialized" | ||
81 | } | ||
82 | sleep 1 | ||
83 | |||
84 | send -- "ls -l /home | wc -l\r" | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 5\n";exit} | ||
87 | "2" | ||
88 | } | ||
89 | after 100 | ||
90 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
93 | "0" | ||
94 | } | ||
95 | after 100 | ||
96 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
99 | "0" | ||
100 | } | ||
101 | after 100 | ||
102 | send -- "exit\r" | ||
103 | sleep 1 | ||
104 | |||
105 | |||
106 | puts "\nall done\n" | ||