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/filters/caps.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/filters/caps.exp')
-rwxr-xr-x | test/filters/caps.exp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/filters/caps.exp b/test/filters/caps.exp index c29794ea3..29437beea 100755 --- a/test/filters/caps.exp +++ b/test/filters/caps.exp | |||
@@ -10,7 +10,7 @@ match_max 100000 | |||
10 | send -- "firejail --caps.keep=chown,fowner --noprofile\r" | 10 | send -- "firejail --caps.keep=chown,fowner --noprofile\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 1\n";exit} | 12 | timeout {puts "TESTING ERROR 1\n";exit} |
13 | "Child process initialized" | 13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
14 | } | 14 | } |
15 | after 100 | 15 | after 100 |
16 | 16 | ||
@@ -29,7 +29,7 @@ sleep 1 | |||
29 | send -- "firejail --caps.drop=all --noprofile\r" | 29 | send -- "firejail --caps.drop=all --noprofile\r" |
30 | expect { | 30 | expect { |
31 | timeout {puts "TESTING ERROR 4\n";exit} | 31 | timeout {puts "TESTING ERROR 4\n";exit} |
32 | "Child process initialized" | 32 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
33 | } | 33 | } |
34 | after 100 | 34 | after 100 |
35 | 35 | ||
@@ -48,7 +48,7 @@ sleep 1 | |||
48 | send -- "firejail --caps.drop=chown,dac_override,dac_read_search,fowner --noprofile\r" | 48 | send -- "firejail --caps.drop=chown,dac_override,dac_read_search,fowner --noprofile\r" |
49 | expect { | 49 | expect { |
50 | timeout {puts "TESTING ERROR 7\n";exit} | 50 | timeout {puts "TESTING ERROR 7\n";exit} |
51 | "Child process initialized" | 51 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
52 | } | 52 | } |
53 | after 100 | 53 | after 100 |
54 | 54 | ||
@@ -81,7 +81,7 @@ expect { | |||
81 | expect { | 81 | expect { |
82 | timeout {puts "TESTING ERROR 13\n";exit} | 82 | timeout {puts "TESTING ERROR 13\n";exit} |
83 | "Drop CAP_" {puts "TESTING ERROR 14\n";exit} | 83 | "Drop CAP_" {puts "TESTING ERROR 14\n";exit} |
84 | "Child process initialized" | 84 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
85 | } | 85 | } |
86 | after 100 | 86 | after 100 |
87 | send -- "exit\r" | 87 | send -- "exit\r" |
@@ -93,7 +93,7 @@ sleep 1 | |||
93 | #send -- "firejail --profile=caps2.profile\r" | 93 | #send -- "firejail --profile=caps2.profile\r" |
94 | #expect { | 94 | #expect { |
95 | # timeout {puts "TESTING ERROR 15\n";exit} | 95 | # timeout {puts "TESTING ERROR 15\n";exit} |
96 | # "Child process initialized" | 96 | # -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
97 | #} | 97 | #} |
98 | #after 100 | 98 | #after 100 |
99 | # | 99 | # |
@@ -113,7 +113,7 @@ sleep 1 | |||
113 | send -- "firejail --profile=caps3.profile\r" | 113 | send -- "firejail --profile=caps3.profile\r" |
114 | expect { | 114 | expect { |
115 | timeout {puts "TESTING ERROR 18\n";exit} | 115 | timeout {puts "TESTING ERROR 18\n";exit} |
116 | "Child process initialized" | 116 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
117 | } | 117 | } |
118 | after 100 | 118 | after 100 |
119 | 119 | ||