aboutsummaryrefslogtreecommitdiffstats
path: root/test/root/whitelist.exp
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2022-02-09 18:04:36 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2022-02-09 18:30:45 +0100
commit7578e86ef8ddb78da44d426b94def77366627e0e (patch)
treee752d23f1b61a50fb7b7372d6799fe9ef4d111e4 /test/root/whitelist.exp
parentMerge pull request #4915 from kmk3/keepassx-restore-nou2f (diff)
downloadfirejail-7578e86ef8ddb78da44d426b94def77366627e0e.tar.gz
firejail-7578e86ef8ddb78da44d426b94def77366627e0e.tar.zst
firejail-7578e86ef8ddb78da44d426b94def77366627e0e.zip
testing: fix expect matching of numbers
The sandbox timestamp should not be available for matching when output is already expected from the next command (this is only a problem if numeric output if expected from the first command in the sandbox). A possible alternative would be to flush the expect output buffer with 'expect "*"' after the sandbox is up.
Diffstat (limited to 'test/root/whitelist.exp')
-rwxr-xr-xtest/root/whitelist.exp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/root/whitelist.exp b/test/root/whitelist.exp
index 1e29e3fef..2397f6a90 100755
--- a/test/root/whitelist.exp
+++ b/test/root/whitelist.exp
@@ -16,7 +16,7 @@ after 100
16send -- "firejail --whitelist=/mnt/firejail-test-file --whitelist=/mnt/firejail-test-dir --debug\r" 16send -- "firejail --whitelist=/mnt/firejail-test-file --whitelist=/mnt/firejail-test-dir --debug\r"
17expect { 17expect {
18 timeout {puts "TESTING ERROR 0\n";exit} 18 timeout {puts "TESTING ERROR 0\n";exit}
19 "Child process initialized" 19 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
20} 20}
21sleep 1 21sleep 1
22 22
@@ -39,7 +39,7 @@ after 100
39send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r" 39send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r"
40expect { 40expect {
41 timeout {puts "TESTING ERROR 2\n";exit} 41 timeout {puts "TESTING ERROR 2\n";exit}
42 "Child process initialized" 42 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
43} 43}
44sleep 1 44sleep 1
45 45
@@ -61,7 +61,7 @@ after 100
61send -- "firejail --whitelist=/media/firejail-test-file --whitelist=/media/firejail-test-dir --debug\r" 61send -- "firejail --whitelist=/media/firejail-test-file --whitelist=/media/firejail-test-dir --debug\r"
62expect { 62expect {
63 timeout {puts "TESTING ERROR 4\n";exit} 63 timeout {puts "TESTING ERROR 4\n";exit}
64 "Child process initialized" 64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65} 65}
66sleep 1 66sleep 1
67 67
@@ -78,7 +78,7 @@ sleep 1
78send -- "firejail --whitelist=/var/run --whitelist=/var/lock --debug\r" 78send -- "firejail --whitelist=/var/run --whitelist=/var/lock --debug\r"
79expect { 79expect {
80 timeout {puts "TESTING ERROR 6\n";exit} 80 timeout {puts "TESTING ERROR 6\n";exit}
81 "Child process initialized" 81 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
82} 82}
83sleep 1 83sleep 1
84 84
@@ -100,7 +100,7 @@ after 100
100send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r" 100send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r"
101expect { 101expect {
102 timeout {puts "TESTING ERROR 8\n";exit} 102 timeout {puts "TESTING ERROR 8\n";exit}
103 "Child process initialized" 103 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
104} 104}
105sleep 1 105sleep 1
106 106