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/utils/name.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/name.exp')
-rwxr-xr-x | test/utils/name.exp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/utils/name.exp b/test/utils/name.exp index ade119183..cd4465d41 100755 --- a/test/utils/name.exp +++ b/test/utils/name.exp | |||
@@ -11,7 +11,7 @@ match_max 100000 | |||
11 | send -- "firejail --name=ftest\r" | 11 | send -- "firejail --name=ftest\r" |
12 | expect { | 12 | expect { |
13 | timeout {puts "TESTING ERROR 0\n";exit} | 13 | timeout {puts "TESTING ERROR 0\n";exit} |
14 | "Child process initialized" | 14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
15 | } | 15 | } |
16 | after 100 | 16 | after 100 |
17 | 17 | ||
@@ -19,7 +19,7 @@ spawn $env(SHELL) | |||
19 | send -- "firejail --name=ftest\r" | 19 | send -- "firejail --name=ftest\r" |
20 | expect { | 20 | expect { |
21 | timeout {puts "TESTING ERROR 1\n";exit} | 21 | timeout {puts "TESTING ERROR 1\n";exit} |
22 | "Child process initialized" | 22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
23 | } | 23 | } |
24 | after 100 | 24 | after 100 |
25 | 25 | ||
@@ -27,7 +27,7 @@ spawn $env(SHELL) | |||
27 | send -- "firejail --name=ftest\r" | 27 | send -- "firejail --name=ftest\r" |
28 | expect { | 28 | expect { |
29 | timeout {puts "TESTING ERROR 2\n";exit} | 29 | timeout {puts "TESTING ERROR 2\n";exit} |
30 | "Child process initialized" | 30 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
31 | } | 31 | } |
32 | after 100 | 32 | after 100 |
33 | 33 | ||
@@ -35,7 +35,7 @@ spawn $env(SHELL) | |||
35 | send -- "firejail --name=ftest\r" | 35 | send -- "firejail --name=ftest\r" |
36 | expect { | 36 | expect { |
37 | timeout {puts "TESTING ERROR 3\n";exit} | 37 | timeout {puts "TESTING ERROR 3\n";exit} |
38 | "Child process initialized" | 38 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
39 | } | 39 | } |
40 | after 100 | 40 | after 100 |
41 | 41 | ||
@@ -43,7 +43,7 @@ spawn $env(SHELL) | |||
43 | send -- "firejail --name=ftest\r" | 43 | send -- "firejail --name=ftest\r" |
44 | expect { | 44 | expect { |
45 | timeout {puts "TESTING ERROR 4\n";exit} | 45 | timeout {puts "TESTING ERROR 4\n";exit} |
46 | "Child process initialized" | 46 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
47 | } | 47 | } |
48 | after 100 | 48 | after 100 |
49 | 49 | ||
@@ -51,7 +51,7 @@ spawn $env(SHELL) | |||
51 | send -- "firejail --name=ftest\r" | 51 | send -- "firejail --name=ftest\r" |
52 | expect { | 52 | expect { |
53 | timeout {puts "TESTING ERROR 5\n";exit} | 53 | timeout {puts "TESTING ERROR 5\n";exit} |
54 | "Child process initialized" | 54 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
55 | } | 55 | } |
56 | after 100 | 56 | after 100 |
57 | 57 | ||
@@ -59,7 +59,7 @@ spawn $env(SHELL) | |||
59 | send -- "firejail --name=ftest\r" | 59 | send -- "firejail --name=ftest\r" |
60 | expect { | 60 | expect { |
61 | timeout {puts "TESTING ERROR 6\n";exit} | 61 | timeout {puts "TESTING ERROR 6\n";exit} |
62 | "Child process initialized" | 62 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
63 | } | 63 | } |
64 | after 100 | 64 | after 100 |
65 | 65 | ||
@@ -67,7 +67,7 @@ spawn $env(SHELL) | |||
67 | send -- "firejail --name=ftest\r" | 67 | send -- "firejail --name=ftest\r" |
68 | expect { | 68 | expect { |
69 | timeout {puts "TESTING ERROR 7\n";exit} | 69 | timeout {puts "TESTING ERROR 7\n";exit} |
70 | "Child process initialized" | 70 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
71 | } | 71 | } |
72 | after 100 | 72 | after 100 |
73 | 73 | ||
@@ -75,7 +75,7 @@ spawn $env(SHELL) | |||
75 | send -- "firejail --name=ftest\r" | 75 | send -- "firejail --name=ftest\r" |
76 | expect { | 76 | expect { |
77 | timeout {puts "TESTING ERROR 8\n";exit} | 77 | timeout {puts "TESTING ERROR 8\n";exit} |
78 | "Child process initialized" | 78 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
79 | } | 79 | } |
80 | after 100 | 80 | after 100 |
81 | 81 | ||
@@ -83,7 +83,7 @@ spawn $env(SHELL) | |||
83 | send -- "firejail --name=ftest\r" | 83 | send -- "firejail --name=ftest\r" |
84 | expect { | 84 | expect { |
85 | timeout {puts "TESTING ERROR 9\n";exit} | 85 | timeout {puts "TESTING ERROR 9\n";exit} |
86 | "Child process initialized" | 86 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
87 | } | 87 | } |
88 | after 100 | 88 | after 100 |
89 | 89 | ||
@@ -91,7 +91,7 @@ spawn $env(SHELL) | |||
91 | send -- "firejail --name=ftest\r" | 91 | send -- "firejail --name=ftest\r" |
92 | expect { | 92 | expect { |
93 | timeout {puts "TESTING ERROR 10\n";exit} | 93 | timeout {puts "TESTING ERROR 10\n";exit} |
94 | "Child process initialized" | 94 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
95 | } | 95 | } |
96 | after 100 | 96 | after 100 |
97 | 97 | ||
@@ -99,7 +99,7 @@ spawn $env(SHELL) | |||
99 | send -- "firejail --name=ftest\r" | 99 | send -- "firejail --name=ftest\r" |
100 | expect { | 100 | expect { |
101 | timeout {puts "TESTING ERROR 11\n";exit} | 101 | timeout {puts "TESTING ERROR 11\n";exit} |
102 | "Child process initialized" | 102 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
103 | } | 103 | } |
104 | after 100 | 104 | after 100 |
105 | 105 | ||