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/join5.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/join5.exp')
-rwxr-xr-x | test/utils/join5.exp | 16 |
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 | ||
10 | send -- "firejail --name=test123 --profile=join5.profile\r" | 10 | send -- "firejail --name=test123 --profile=join5.profile\r" |
11 | expect { | 11 | expect { |
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 | } |
15 | sleep 1 | 15 | sleep 1 |
16 | spawn $env(SHELL) | 16 | spawn $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 | } |
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
25 | } | ||
22 | sleep 1 | 26 | sleep 1 |
23 | send -- "ps aux\r" | 27 | send -- "ps aux\r" |
24 | expect { | 28 | expect { |
25 | timeout {puts "TESTING ERROR 2\n";exit} | 29 | timeout {puts "TESTING ERROR 3\n";exit} |
26 | "/bin/bash" | 30 | "/bin/bash" |
27 | } | 31 | } |
28 | expect { | 32 | expect { |
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 | ||
36 | send -- "firejail --protocol.print=test123\r" | 40 | send -- "firejail --protocol.print=test123\r" |
37 | expect { | 41 | expect { |
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 | } |
41 | expect { | 45 | expect { |
42 | timeout {puts "TESTING ERROR 5\n";exit} | 46 | timeout {puts "TESTING ERROR 6\n";exit} |
43 | "unix" | 47 | "unix" |
44 | } | 48 | } |
45 | 49 | ||