diff options
author | smitsohu <smitsohu@gmail.com> | 2022-02-09 18:04:36 +0100 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2022-02-09 18:30:45 +0100 |
commit | 7578e86ef8ddb78da44d426b94def77366627e0e (patch) | |
tree | e752d23f1b61a50fb7b7372d6799fe9ef4d111e4 /test/environment/dns.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/environment/dns.exp')
-rwxr-xr-x | test/environment/dns.exp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/environment/dns.exp b/test/environment/dns.exp index 1fe6449b7..b5a8c119b 100755 --- a/test/environment/dns.exp +++ b/test/environment/dns.exp | |||
@@ -30,7 +30,7 @@ expect { | |||
30 | } | 30 | } |
31 | expect { | 31 | expect { |
32 | timeout {puts "TESTING ERROR 1.5\n";exit} | 32 | timeout {puts "TESTING ERROR 1.5\n";exit} |
33 | "Child process initialized" | 33 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
34 | } | 34 | } |
35 | expect { | 35 | expect { |
36 | timeout {puts "TESTING ERROR 1.6\n";exit} | 36 | timeout {puts "TESTING ERROR 1.6\n";exit} |
@@ -47,7 +47,7 @@ expect { | |||
47 | "DNS server 8.8.8.8" {puts "TESTING ERROR 2.3\n";exit} | 47 | "DNS server 8.8.8.8" {puts "TESTING ERROR 2.3\n";exit} |
48 | "DNS server 4.2.2.1" {puts "TESTING ERROR 2.4\n";exit} | 48 | "DNS server 4.2.2.1" {puts "TESTING ERROR 2.4\n";exit} |
49 | "DNS server ::2" {puts "TESTING ERROR 2.5\n";exit} | 49 | "DNS server ::2" {puts "TESTING ERROR 2.5\n";exit} |
50 | "Child process initialized" {puts "TESTING ERROR 2.6\n";exit} | 50 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "TESTING ERROR 2.6\n";exit} |
51 | "Parent is shutting down, bye..." {puts "TESTING ERROR 2.7\n";exit} | 51 | "Parent is shutting down, bye..." {puts "TESTING ERROR 2.7\n";exit} |
52 | "root" | 52 | "root" |
53 | } | 53 | } |
@@ -56,7 +56,7 @@ after 100 | |||
56 | send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2\r" | 56 | send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2\r" |
57 | expect { | 57 | expect { |
58 | timeout {puts "TESTING ERROR 3\n";exit} | 58 | timeout {puts "TESTING ERROR 3\n";exit} |
59 | "Child process initialized" | 59 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
60 | } | 60 | } |
61 | sleep 1 | 61 | sleep 1 |
62 | 62 | ||
@@ -85,7 +85,7 @@ sleep 1 | |||
85 | send -- "firejail --profile=dns.profile\r" | 85 | send -- "firejail --profile=dns.profile\r" |
86 | expect { | 86 | expect { |
87 | timeout {puts "TESTING ERROR 5.1\n";exit} | 87 | timeout {puts "TESTING ERROR 5.1\n";exit} |
88 | "Child process initialized" | 88 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
89 | } | 89 | } |
90 | sleep 1 | 90 | sleep 1 |
91 | 91 | ||