aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/whitelist-dev.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-08-19 14:16:17 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-08-19 14:16:17 -0400
commit7ad4051e3fa733e72272b3568b1cd443779e16eb (patch)
tree5d51c3209988eca9c64122114c1585e0407cfd2a /test/fs/whitelist-dev.exp
parenttesting (diff)
downloadfirejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.tar.gz
firejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.tar.zst
firejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.zip
testing
Diffstat (limited to 'test/fs/whitelist-dev.exp')
-rwxr-xr-xtest/fs/whitelist-dev.exp95
1 files changed, 56 insertions, 39 deletions
diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp
index bc0970091..fca3fdfe5 100755
--- a/test/fs/whitelist-dev.exp
+++ b/test/fs/whitelist-dev.exp
@@ -38,67 +38,84 @@ expect {
38} 38}
39after 100 39after 100
40 40
41set have_dvd 0
41send -- "ls -l /dev\r" 42send -- "ls -l /dev\r"
42expect { 43expect {
43 timeout {puts "TESTING ERROR 4\n";exit} 44 "dvd" {set have_dvd 1}
44 "dvd" {puts "OK\n"}
45} 45}
46after 100 46after 100
47 47
48
49set have_dri 0
48send -- "ls -l /dev\r" 50send -- "ls -l /dev\r"
49expect { 51expect {
50 timeout {puts "TESTING ERROR 5\n";exit} 52 "dri" {set have_dri 1}
51 "dri" {puts "OK\n"}
52} 53}
53after 100 54after 100
54 55
56set have_snd 0
55send -- "ls -l /dev\r" 57send -- "ls -l /dev\r"
56expect { 58expect {
57 timeout {puts "TESTING ERROR 6\n";exit} 59 "snd" {set have_snd 1}
58 "snd" {puts "OK\n"}
59} 60}
60after 100 61after 100
61 62
62send -- "exit\r" 63send -- "exit\r"
63sleep 1 64sleep 1
64 65
65send -- "firejail --private-dev --nosound ls /dev\r" 66if { $have_snd > 0 } {
66expect { 67 puts "TESTING --private-dev --nosound\n"
67 timeout {puts "TESTING ERROR 7\n";exit} 68 send -- "firejail --private-dev --nosound ls /dev\r"
68 "Child process initialized" 69 expect {
69} 70 timeout {puts "TESTING ERROR 7\n";exit}
70expect { 71 "Child process initialized"
71 timeout {puts "TESTING ERROR 8\n";exit} 72 }
72 "snd" {puts "TESTING ERROR 9\n";exit} 73 expect {
73 "Parent is shutting down" 74 timeout {puts "TESTING ERROR 8\n";exit}
75 "snd" {puts "TESTING ERROR 9\n";exit}
76 "Parent is shutting down"
77 }
78 after 100
79} else {
80 puts "TESTING skip --private-dev --nosound, no /dev/snd device available\n"
74} 81}
75sleep 1
76 82
77send -- "firejail --private-dev --nodvd ls /dev\r" 83if { $have_dvd > 0 } {
78expect { 84 puts "TESTING --private-dev --nodvd\n"
79 timeout {puts "TESTING ERROR 10\n";exit} 85 send -- "firejail --private-dev --nodvd ls /dev\r"
80 "Child process initialized" 86 expect {
87 timeout {puts "TESTING ERROR 10\n";exit}
88 "Child process initialized"
89 }
90 expect {
91 timeout {puts "TESTING ERROR 11\n";exit}
92 "dvd" {puts "TESTING ERROR 12\n";exit}
93 "cdrom" {puts "TESTING ERROR 13\n";exit}
94 "dvdrom" {puts "TESTING ERROR 14\n";exit}
95 "cdrw" {puts "TESTING ERROR 15\n";exit}
96 "dvdrw" {puts "TESTING ERROR 16\n";exit}
97 "Parent is shutting down"
98 }
99 after 100
100} else {
101 puts "TESTING skip --private-dev --nodvd, no /dev/dvd device available\n"
81} 102}
82expect {
83 timeout {puts "TESTING ERROR 11\n";exit}
84 "dvd" {puts "TESTING ERROR 12\n";exit}
85 "cdrom" {puts "TESTING ERROR 13\n";exit}
86 "dvdrom" {puts "TESTING ERROR 14\n";exit}
87 "cdrw" {puts "TESTING ERROR 15\n";exit}
88 "dvdrw" {puts "TESTING ERROR 16\n";exit}
89 "Parent is shutting down"
90}
91sleep 1
92 103
93send -- "firejail --private-dev --no3d ls /dev\r" 104if { $have_dri > 0 } {
94expect { 105 puts "TESTING --private-dev --no3d\n"
95 timeout {puts "TESTING ERROR 17\n";exit} 106 send -- "firejail --private-dev --no3d ls /dev\r"
96 "Child process initialized" 107 expect {
97} 108 timeout {puts "TESTING ERROR 17\n";exit}
98expect { 109 "Child process initialized"
99 timeout {puts "TESTING ERROR 18\n";exit} 110 }
100 "dri" {puts "TESTING ERROR 19\n";exit} 111 expect {
101 "Parent is shutting down" 112 timeout {puts "TESTING ERROR 18\n";exit}
113 "dri" {puts "TESTING ERROR 19\n";exit}
114 "Parent is shutting down"
115 }
116 after 100
117} else {
118 puts "TESTING skip --private-dev --no3d, no /dev/dri device available\n"
102} 119}
103 120
104after 100 121after 100