aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/trace.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/trace.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/trace.exp')
-rwxr-xr-xtest/utils/trace.exp14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/utils/trace.exp b/test/utils/trace.exp
index 890884248..f14001c88 100755
--- a/test/utils/trace.exp
+++ b/test/utils/trace.exp
@@ -10,7 +10,7 @@ match_max 100000
10send -- "firejail --trace mkdir ttt\r" 10send -- "firejail --trace mkdir ttt\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\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}
15expect { 15expect {
16 timeout {puts "TESTING ERROR 1\n";exit} 16 timeout {puts "TESTING ERROR 1\n";exit}
@@ -21,7 +21,7 @@ sleep 1
21send -- "firejail --trace rmdir ttt\r" 21send -- "firejail --trace rmdir ttt\r"
22expect { 22expect {
23 timeout {puts "TESTING ERROR 2\n";exit} 23 timeout {puts "TESTING ERROR 2\n";exit}
24 "Child process initialized" 24 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
25} 25}
26expect { 26expect {
27 timeout {puts "TESTING ERROR 3\n";exit} 27 timeout {puts "TESTING ERROR 3\n";exit}
@@ -32,7 +32,7 @@ sleep 1
32send -- "firejail --trace touch ttt\r" 32send -- "firejail --trace touch ttt\r"
33expect { 33expect {
34 timeout {puts "TESTING ERROR 4\n";exit} 34 timeout {puts "TESTING ERROR 4\n";exit}
35 "Child process initialized" 35 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
36} 36}
37expect { 37expect {
38 timeout {puts "TESTING ERROR 5\n";exit} 38 timeout {puts "TESTING ERROR 5\n";exit}
@@ -44,7 +44,7 @@ sleep 1
44send -- "firejail --trace rm ttt\r" 44send -- "firejail --trace rm ttt\r"
45expect { 45expect {
46 timeout {puts "TESTING ERROR 6\n";exit} 46 timeout {puts "TESTING ERROR 6\n";exit}
47 "Child process initialized" 47 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
48} 48}
49expect { 49expect {
50 timeout {puts "TESTING ERROR 7\n";exit} 50 timeout {puts "TESTING ERROR 7\n";exit}
@@ -55,7 +55,7 @@ sleep 1
55send -- "firejail --trace wget -q debian.org\r" 55send -- "firejail --trace wget -q debian.org\r"
56#expect { 56#expect {
57# timeout {puts "TESTING ERROR 8.1\n";exit} 57# timeout {puts "TESTING ERROR 8.1\n";exit}
58# "Child process initialized" 58# -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
59#} 59#}
60#expect { 60#expect {
61# timeout {puts "TESTING ERROR 8.2\n";exit} 61# timeout {puts "TESTING ERROR 8.2\n";exit}
@@ -86,7 +86,7 @@ sleep 1
86send -- "firejail --trace rm index.html\r" 86send -- "firejail --trace rm index.html\r"
87expect { 87expect {
88 timeout {puts "TESTING ERROR 9\n";exit} 88 timeout {puts "TESTING ERROR 9\n";exit}
89 "Child process initialized" 89 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
90} 90}
91expect { 91expect {
92 timeout {puts "TESTING ERROR 10\n";exit} 92 timeout {puts "TESTING ERROR 10\n";exit}
@@ -98,7 +98,7 @@ sleep 1
98send -- "firejail --trace\r" 98send -- "firejail --trace\r"
99expect { 99expect {
100 timeout {puts "TESTING ERROR 11\n";exit} 100 timeout {puts "TESTING ERROR 11\n";exit}
101 "Child process initialized" 101 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
102} 102}
103expect { 103expect {
104 timeout {puts "TESTING ERROR 12\n";exit} 104 timeout {puts "TESTING ERROR 12\n";exit}