aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/join5.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/utils/join5.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/utils/join5.exp')
-rwxr-xr-xtest/utils/join5.exp16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/utils/join5.exp b/test/utils/join5.exp
index 44167cffb..c0990ebf1 100755
--- a/test/utils/join5.exp
+++ b/test/utils/join5.exp
@@ -9,8 +9,8 @@ match_max 100000
9 9
10send -- "firejail --name=test123 --profile=join5.profile\r" 10send -- "firejail --name=test123 --profile=join5.profile\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 5\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14} 14}
15sleep 1 15sleep 1
16spawn $env(SHELL) 16spawn $env(SHELL)
@@ -19,14 +19,18 @@ expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
20 "Switching to pid" 20 "Switching to pid"
21} 21}
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
25}
22sleep 1 26sleep 1
23send -- "ps aux\r" 27send -- "ps aux\r"
24expect { 28expect {
25 timeout {puts "TESTING ERROR 2\n";exit} 29 timeout {puts "TESTING ERROR 3\n";exit}
26 "/bin/bash" 30 "/bin/bash"
27} 31}
28expect { 32expect {
29 timeout {puts "TESTING ERROR 3\n";exit} 33 timeout {puts "TESTING ERROR 4\n";exit}
30 "/bin/bash" 34 "/bin/bash"
31} 35}
32 36
@@ -35,11 +39,11 @@ after 100
35 39
36send -- "firejail --protocol.print=test123\r" 40send -- "firejail --protocol.print=test123\r"
37expect { 41expect {
38 timeout {puts "TESTING ERROR 4\n";exit} 42 timeout {puts "TESTING ERROR 5\n";exit}
39 "Switching to pid" 43 "Switching to pid"
40} 44}
41expect { 45expect {
42 timeout {puts "TESTING ERROR 5\n";exit} 46 timeout {puts "TESTING ERROR 6\n";exit}
43 "unix" 47 "unix"
44} 48}
45 49