diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-08 11:55:57 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-08 11:55:57 -0500 |
commit | 62a19b0cac1646b0187e860f9edfb0843f572d1e (patch) | |
tree | 6d76d83dd3a7b901be200b7c8b610c9fbf8ef105 /test/fs/private.exp | |
parent | testing (diff) | |
download | firejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.tar.gz firejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.tar.zst firejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.zip |
testing
Diffstat (limited to 'test/fs/private.exp')
-rwxr-xr-x | test/fs/private.exp | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/test/fs/private.exp b/test/fs/private.exp index 67435b888..8114ee45d 100755 --- a/test/fs/private.exp +++ b/test/fs/private.exp | |||
@@ -7,53 +7,52 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | if { $argc != 1 } { | 10 | |
11 | puts "TESTING ERROR: argument missing" | 11 | if {[file exists ~/.asoundrc]} { |
12 | puts "Usage: private.exp username" | 12 | puts "found .asoundrc file\n" |
13 | puts "where username is the name of the current user" | 13 | } else { |
14 | exit | 14 | send -- "touch ~/.asoundrc\r" |
15 | } | 15 | } |
16 | after 100 | ||
17 | |||
18 | if {[file exists ~/.Xauthority]} { | ||
19 | puts "found .Xauthority file\n" | ||
20 | } else { | ||
21 | send -- "touch ~/.Xauthority\r" | ||
22 | } | ||
23 | after 100 | ||
16 | 24 | ||
17 | # testing profile and private | 25 | # testing profile and private |
18 | send -- "firejail --private --profile=/etc/firejail/default.profile\r" | 26 | send -- "firejail --private\r" |
19 | expect { | 27 | expect { |
20 | timeout {puts "TESTING ERROR 0\n";exit} | 28 | timeout {puts "TESTING ERROR 0\n";exit} |
21 | "Child process initialized" | 29 | "Child process initialized" |
22 | } | 30 | } |
23 | sleep 1 | 31 | sleep 1 |
24 | send -- "exit\r" | ||
25 | sleep 1 | ||
26 | 32 | ||
27 | send -- "firejail --private --noprofile\r" | 33 | send -- "ls -l ~\r" |
28 | expect { | 34 | expect { |
29 | timeout {puts "TESTING ERROR 1\n";exit} | 35 | timeout {puts "TESTING ERROR 1\n";exit} |
30 | "Child process initialized" | 36 | "total 0" |
31 | } | 37 | } |
38 | after 100 | ||
32 | 39 | ||
33 | sleep 1 | 40 | send -- "ls -al ~\r" |
34 | send -- "cd ~; ls -al; echo done\r" | ||
35 | expect { | 41 | expect { |
36 | timeout {puts "TESTING ERROR 2\n";exit} | 42 | timeout {puts "TESTING ERROR 2\n";exit} |
37 | ".bashrc" | 43 | ".asoundrc" |
38 | } | 44 | } |
39 | expect { | 45 | expect { |
40 | timeout {puts "TESTING ERROR 3\n";exit} | 46 | timeout {puts "TESTING ERROR 3\n";exit} |
41 | done | 47 | ".bashrc" |
42 | } | ||
43 | |||
44 | # owner /tmp | ||
45 | send -- "stat -c %U%a /tmp;echo done\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 10\n";exit} | ||
48 | "root777" {puts "version 1\n";} | ||
49 | "root1777" {puts "version 2\n";} | ||
50 | "nobody777" {puts "version 3\n";} | ||
51 | "nobody1777" {puts "version 4\n";} | ||
52 | } | 48 | } |
53 | expect { | 49 | expect { |
54 | timeout {puts "TESTING ERROR 11\n";exit} | 50 | timeout {puts "TESTING ERROR 4\n";exit} |
55 | "done" | 51 | ".Xauthority" |
56 | } | 52 | } |
57 | after 100 | 53 | after 100 |
58 | 54 | ||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | |||
59 | puts "all done\n" | 58 | puts "all done\n" |