diff options
author | 2023-02-28 09:51:26 -0500 | |
---|---|---|
committer | 2023-02-28 09:51:26 -0500 | |
commit | 27c4d069f322fbeca07c88e0e96208233103a5db (patch) | |
tree | fb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test/features/1.4.exp | |
parent | fix cppcheck/scan-build problems (diff) | |
download | firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip |
chroot testing
Diffstat (limited to 'test/features/1.4.exp')
-rwxr-xr-x | test/features/1.4.exp | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/test/features/1.4.exp b/test/features/1.4.exp deleted file mode 100755 index f5db0c450..000000000 --- a/test/features/1.4.exp +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | # | ||
6 | # mask other users | ||
7 | # | ||
8 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /home | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "2" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
34 | "0" | ||
35 | } | ||
36 | after 100 | ||
37 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
40 | "0" | ||
41 | } | ||
42 | after 100 | ||
43 | |||
44 | send -- "exit\r" | ||
45 | sleep 1 | ||
46 | |||
47 | |||
48 | # | ||
49 | # O | ||
50 | # | ||
51 | if { $overlay == "overlay" } { | ||
52 | send -- "firejail --noprofile --overlay\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 2\n";exit} | ||
55 | "overlay option is not available" {puts "grsecurity\n"; exit} | ||
56 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"} | ||
57 | } | ||
58 | sleep 1 | ||
59 | |||
60 | send -- "ls -l /home | wc -l\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 3\n";exit} | ||
63 | "2" | ||
64 | } | ||
65 | after 100 | ||
66 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
69 | "0" | ||
70 | } | ||
71 | after 100 | ||
72 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
75 | "0" | ||
76 | } | ||
77 | after 100 | ||
78 | send -- "exit\r" | ||
79 | sleep 1 | ||
80 | } | ||
81 | |||
82 | # | ||
83 | # C | ||
84 | # | ||
85 | if { $chroot == "chroot" } { | ||
86 | send -- "firejail --noprofile --chroot=/tmp/chroot\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 4\n";exit} | ||
89 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
90 | } | ||
91 | sleep 1 | ||
92 | |||
93 | send -- "ls -l /home | wc -l\r" | ||
94 | expect { | ||
95 | timeout {puts "TESTING ERROR 5\n";exit} | ||
96 | "2" | ||
97 | } | ||
98 | after 100 | ||
99 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
100 | expect { | ||
101 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
102 | "0" | ||
103 | } | ||
104 | after 100 | ||
105 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
108 | "0" | ||
109 | } | ||
110 | after 100 | ||
111 | send -- "exit\r" | ||
112 | sleep 1 | ||
113 | } | ||
114 | |||
115 | |||
116 | puts "\nall done\n" | ||