diff options
author | 2022-02-09 18:04:36 +0100 | |
---|---|---|
committer | 2022-02-09 18:30:45 +0100 | |
commit | 7578e86ef8ddb78da44d426b94def77366627e0e (patch) | |
tree | e752d23f1b61a50fb7b7372d6799fe9ef4d111e4 /test/utils/trace.exp | |
parent | Merge pull request #4915 from kmk3/keepassx-restore-nou2f (diff) | |
download | firejail-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-x | test/utils/trace.exp | 14 |
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 | |||
10 | send -- "firejail --trace mkdir ttt\r" | 10 | send -- "firejail --trace mkdir ttt\r" |
11 | expect { | 11 | expect { |
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 | } |
15 | expect { | 15 | expect { |
16 | timeout {puts "TESTING ERROR 1\n";exit} | 16 | timeout {puts "TESTING ERROR 1\n";exit} |
@@ -21,7 +21,7 @@ sleep 1 | |||
21 | send -- "firejail --trace rmdir ttt\r" | 21 | send -- "firejail --trace rmdir ttt\r" |
22 | expect { | 22 | expect { |
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 | } |
26 | expect { | 26 | expect { |
27 | timeout {puts "TESTING ERROR 3\n";exit} | 27 | timeout {puts "TESTING ERROR 3\n";exit} |
@@ -32,7 +32,7 @@ sleep 1 | |||
32 | send -- "firejail --trace touch ttt\r" | 32 | send -- "firejail --trace touch ttt\r" |
33 | expect { | 33 | expect { |
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 | } |
37 | expect { | 37 | expect { |
38 | timeout {puts "TESTING ERROR 5\n";exit} | 38 | timeout {puts "TESTING ERROR 5\n";exit} |
@@ -44,7 +44,7 @@ sleep 1 | |||
44 | send -- "firejail --trace rm ttt\r" | 44 | send -- "firejail --trace rm ttt\r" |
45 | expect { | 45 | expect { |
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 | } |
49 | expect { | 49 | expect { |
50 | timeout {puts "TESTING ERROR 7\n";exit} | 50 | timeout {puts "TESTING ERROR 7\n";exit} |
@@ -55,7 +55,7 @@ sleep 1 | |||
55 | send -- "firejail --trace wget -q debian.org\r" | 55 | send -- "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 | |||
86 | send -- "firejail --trace rm index.html\r" | 86 | send -- "firejail --trace rm index.html\r" |
87 | expect { | 87 | expect { |
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 | } |
91 | expect { | 91 | expect { |
92 | timeout {puts "TESTING ERROR 10\n";exit} | 92 | timeout {puts "TESTING ERROR 10\n";exit} |
@@ -98,7 +98,7 @@ sleep 1 | |||
98 | send -- "firejail --trace\r" | 98 | send -- "firejail --trace\r" |
99 | expect { | 99 | expect { |
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 | } |
103 | expect { | 103 | expect { |
104 | timeout {puts "TESTING ERROR 12\n";exit} | 104 | timeout {puts "TESTING ERROR 12\n";exit} |