diff options
author | netblue30 <netblue30@yahoo.com> | 2017-08-19 14:16:17 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-08-19 14:16:17 -0400 |
commit | 7ad4051e3fa733e72272b3568b1cd443779e16eb (patch) | |
tree | 5d51c3209988eca9c64122114c1585e0407cfd2a /test/fs/whitelist-dev.exp | |
parent | testing (diff) | |
download | firejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.tar.gz firejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.tar.zst firejail-7ad4051e3fa733e72272b3568b1cd443779e16eb.zip |
testing
Diffstat (limited to 'test/fs/whitelist-dev.exp')
-rwxr-xr-x | test/fs/whitelist-dev.exp | 95 |
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 | } |
39 | after 100 | 39 | after 100 |
40 | 40 | ||
41 | set have_dvd 0 | ||
41 | send -- "ls -l /dev\r" | 42 | send -- "ls -l /dev\r" |
42 | expect { | 43 | expect { |
43 | timeout {puts "TESTING ERROR 4\n";exit} | 44 | "dvd" {set have_dvd 1} |
44 | "dvd" {puts "OK\n"} | ||
45 | } | 45 | } |
46 | after 100 | 46 | after 100 |
47 | 47 | ||
48 | |||
49 | set have_dri 0 | ||
48 | send -- "ls -l /dev\r" | 50 | send -- "ls -l /dev\r" |
49 | expect { | 51 | expect { |
50 | timeout {puts "TESTING ERROR 5\n";exit} | 52 | "dri" {set have_dri 1} |
51 | "dri" {puts "OK\n"} | ||
52 | } | 53 | } |
53 | after 100 | 54 | after 100 |
54 | 55 | ||
56 | set have_snd 0 | ||
55 | send -- "ls -l /dev\r" | 57 | send -- "ls -l /dev\r" |
56 | expect { | 58 | expect { |
57 | timeout {puts "TESTING ERROR 6\n";exit} | 59 | "snd" {set have_snd 1} |
58 | "snd" {puts "OK\n"} | ||
59 | } | 60 | } |
60 | after 100 | 61 | after 100 |
61 | 62 | ||
62 | send -- "exit\r" | 63 | send -- "exit\r" |
63 | sleep 1 | 64 | sleep 1 |
64 | 65 | ||
65 | send -- "firejail --private-dev --nosound ls /dev\r" | 66 | if { $have_snd > 0 } { |
66 | expect { | 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} |
70 | expect { | 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 | } |
75 | sleep 1 | ||
76 | 82 | ||
77 | send -- "firejail --private-dev --nodvd ls /dev\r" | 83 | if { $have_dvd > 0 } { |
78 | expect { | 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 | } |
82 | expect { | ||
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 | } | ||
91 | sleep 1 | ||
92 | 103 | ||
93 | send -- "firejail --private-dev --no3d ls /dev\r" | 104 | if { $have_dri > 0 } { |
94 | expect { | 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} |
98 | expect { | 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 | ||
104 | after 100 | 121 | after 100 |