aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-08 11:55:57 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-08 11:55:57 -0500
commit62a19b0cac1646b0187e860f9edfb0843f572d1e (patch)
tree6d76d83dd3a7b901be200b7c8b610c9fbf8ef105 /test/fs/private.exp
parenttesting (diff)
downloadfirejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.tar.gz
firejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.tar.zst
firejail-62a19b0cac1646b0187e860f9edfb0843f572d1e.zip
testing
Diffstat (limited to 'test/fs/private.exp')
-rwxr-xr-xtest/fs/private.exp51
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
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10if { $argc != 1 } { 10
11 puts "TESTING ERROR: argument missing" 11if {[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}
16after 100
17
18if {[file exists ~/.Xauthority]} {
19 puts "found .Xauthority file\n"
20} else {
21 send -- "touch ~/.Xauthority\r"
22}
23after 100
16 24
17# testing profile and private 25# testing profile and private
18send -- "firejail --private --profile=/etc/firejail/default.profile\r" 26send -- "firejail --private\r"
19expect { 27expect {
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}
23sleep 1 31sleep 1
24send -- "exit\r"
25sleep 1
26 32
27send -- "firejail --private --noprofile\r" 33send -- "ls -l ~\r"
28expect { 34expect {
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}
38after 100
32 39
33sleep 1 40send -- "ls -al ~\r"
34send -- "cd ~; ls -al; echo done\r"
35expect { 41expect {
36 timeout {puts "TESTING ERROR 2\n";exit} 42 timeout {puts "TESTING ERROR 2\n";exit}
37 ".bashrc" 43 ".asoundrc"
38} 44}
39expect { 45expect {
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
45send -- "stat -c %U%a /tmp;echo done\r"
46expect {
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}
53expect { 49expect {
54 timeout {puts "TESTING ERROR 11\n";exit} 50 timeout {puts "TESTING ERROR 4\n";exit}
55 "done" 51 ".Xauthority"
56} 52}
57after 100 53after 100
58 54
55send -- "exit\r"
56sleep 1
57
59puts "all done\n" 58puts "all done\n"