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/fs/macro.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/fs/macro.exp')
-rwxr-xr-x | test/fs/macro.exp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/fs/macro.exp b/test/fs/macro.exp index 1d32a9cd0..c01123f41 100755 --- a/test/fs/macro.exp +++ b/test/fs/macro.exp | |||
@@ -11,7 +11,7 @@ match_max 100000 | |||
11 | send -- "firejail --profile=macro-whitelist.profile ls ~\r" | 11 | send -- "firejail --profile=macro-whitelist.profile ls ~\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 | expect { | 16 | expect { |
17 | timeout {puts "TESTING ERROR 1\n";exit} | 17 | timeout {puts "TESTING ERROR 1\n";exit} |
@@ -42,7 +42,7 @@ sleep 1 | |||
42 | send -- "firejail --profile=macro-blacklist.profile ls ~/Desktop\r" | 42 | send -- "firejail --profile=macro-blacklist.profile ls ~/Desktop\r" |
43 | expect { | 43 | expect { |
44 | timeout {puts "TESTING ERROR 7\n";exit} | 44 | timeout {puts "TESTING ERROR 7\n";exit} |
45 | "Child process initialized" | 45 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
46 | } | 46 | } |
47 | expect { | 47 | expect { |
48 | timeout {puts "TESTING ERROR 8\n";exit} | 48 | timeout {puts "TESTING ERROR 8\n";exit} |
@@ -53,7 +53,7 @@ sleep 1 | |||
53 | send -- "firejail --profile=macro-blacklist.profile ls ~/Documents\r" | 53 | send -- "firejail --profile=macro-blacklist.profile ls ~/Documents\r" |
54 | expect { | 54 | expect { |
55 | timeout {puts "TESTING ERROR 9n";exit} | 55 | timeout {puts "TESTING ERROR 9n";exit} |
56 | "Child process initialized" | 56 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
57 | } | 57 | } |
58 | expect { | 58 | expect { |
59 | timeout {puts "TESTING ERROR 10\n";exit} | 59 | timeout {puts "TESTING ERROR 10\n";exit} |
@@ -64,7 +64,7 @@ sleep 1 | |||
64 | send -- "firejail --profile=macro-blacklist.profile ls ~/Downloads\r" | 64 | send -- "firejail --profile=macro-blacklist.profile ls ~/Downloads\r" |
65 | expect { | 65 | expect { |
66 | timeout {puts "TESTING ERROR 11n";exit} | 66 | timeout {puts "TESTING ERROR 11n";exit} |
67 | "Child process initialized" | 67 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
68 | } | 68 | } |
69 | expect { | 69 | expect { |
70 | timeout {puts "TESTING ERROR 12n";exit} | 70 | timeout {puts "TESTING ERROR 12n";exit} |
@@ -75,7 +75,7 @@ sleep 1 | |||
75 | send -- "firejail --profile=macro-blacklist.profile ls ~/Music\r" | 75 | send -- "firejail --profile=macro-blacklist.profile ls ~/Music\r" |
76 | expect { | 76 | expect { |
77 | timeout {puts "TESTING ERROR 13\n";exit} | 77 | timeout {puts "TESTING ERROR 13\n";exit} |
78 | "Child process initialized" | 78 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
79 | } | 79 | } |
80 | expect { | 80 | expect { |
81 | timeout {puts "TESTING ERROR 14\n";exit} | 81 | timeout {puts "TESTING ERROR 14\n";exit} |
@@ -86,7 +86,7 @@ sleep 1 | |||
86 | send -- "firejail --profile=macro-blacklist.profile ls ~/Pictures\r" | 86 | send -- "firejail --profile=macro-blacklist.profile ls ~/Pictures\r" |
87 | expect { | 87 | expect { |
88 | timeout {puts "TESTING ERROR 15\n";exit} | 88 | timeout {puts "TESTING ERROR 15\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 16\n";exit} | 92 | timeout {puts "TESTING ERROR 16\n";exit} |
@@ -97,7 +97,7 @@ sleep 1 | |||
97 | send -- "firejail --profile=macro-blacklist.profile ls ~/Videos\r" | 97 | send -- "firejail --profile=macro-blacklist.profile ls ~/Videos\r" |
98 | expect { | 98 | expect { |
99 | timeout {puts "TESTING ERROR 17\n";exit} | 99 | timeout {puts "TESTING ERROR 17\n";exit} |
100 | "Child process initialized" | 100 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
101 | } | 101 | } |
102 | expect { | 102 | expect { |
103 | timeout {puts "TESTING ERROR 18\n";exit} | 103 | timeout {puts "TESTING ERROR 18\n";exit} |
@@ -108,7 +108,7 @@ sleep 1 | |||
108 | send -- "firejail --profile=macro-readonly.profile touch ~/Desktop/blablabla\r" | 108 | send -- "firejail --profile=macro-readonly.profile touch ~/Desktop/blablabla\r" |
109 | expect { | 109 | expect { |
110 | timeout {puts "TESTING ERROR 19\n";exit} | 110 | timeout {puts "TESTING ERROR 19\n";exit} |
111 | "Child process initialized" | 111 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
112 | } | 112 | } |
113 | expect { | 113 | expect { |
114 | timeout {puts "TESTING ERROR 20\n";exit} | 114 | timeout {puts "TESTING ERROR 20\n";exit} |
@@ -119,7 +119,7 @@ sleep 1 | |||
119 | send -- "firejail --profile=macro-readonly.profile touch ~/Documents/blablabla\r" | 119 | send -- "firejail --profile=macro-readonly.profile touch ~/Documents/blablabla\r" |
120 | expect { | 120 | expect { |
121 | timeout {puts "TESTING ERROR 21\n";exit} | 121 | timeout {puts "TESTING ERROR 21\n";exit} |
122 | "Child process initialized" | 122 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
123 | } | 123 | } |
124 | expect { | 124 | expect { |
125 | timeout {puts "TESTING ERROR 22\n";exit} | 125 | timeout {puts "TESTING ERROR 22\n";exit} |
@@ -130,7 +130,7 @@ sleep 1 | |||
130 | send -- "firejail --profile=macro-readonly.profile touch ~/Downloads/blablabla\r" | 130 | send -- "firejail --profile=macro-readonly.profile touch ~/Downloads/blablabla\r" |
131 | expect { | 131 | expect { |
132 | timeout {puts "TESTING ERROR 23\n";exit} | 132 | timeout {puts "TESTING ERROR 23\n";exit} |
133 | "Child process initialized" | 133 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
134 | } | 134 | } |
135 | expect { | 135 | expect { |
136 | timeout {puts "TESTING ERROR 24\n";exit} | 136 | timeout {puts "TESTING ERROR 24\n";exit} |
@@ -141,7 +141,7 @@ sleep 1 | |||
141 | send -- "firejail --profile=macro-readonly.profile touch ~/Music/blablabla\r" | 141 | send -- "firejail --profile=macro-readonly.profile touch ~/Music/blablabla\r" |
142 | expect { | 142 | expect { |
143 | timeout {puts "TESTING ERROR 25\n";exit} | 143 | timeout {puts "TESTING ERROR 25\n";exit} |
144 | "Child process initialized" | 144 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
145 | } | 145 | } |
146 | expect { | 146 | expect { |
147 | timeout {puts "TESTING ERROR 26\n";exit} | 147 | timeout {puts "TESTING ERROR 26\n";exit} |
@@ -152,7 +152,7 @@ sleep 1 | |||
152 | send -- "firejail --profile=macro-readonly.profile touch ~/Pictures/blablabla\r" | 152 | send -- "firejail --profile=macro-readonly.profile touch ~/Pictures/blablabla\r" |
153 | expect { | 153 | expect { |
154 | timeout {puts "TESTING ERROR 27\n";exit} | 154 | timeout {puts "TESTING ERROR 27\n";exit} |
155 | "Child process initialized" | 155 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
156 | } | 156 | } |
157 | expect { | 157 | expect { |
158 | timeout {puts "TESTING ERROR 28\n";exit} | 158 | timeout {puts "TESTING ERROR 28\n";exit} |
@@ -163,7 +163,7 @@ sleep 1 | |||
163 | send -- "firejail --profile=macro-readonly.profile touch ~/Videos/blablabla\r" | 163 | send -- "firejail --profile=macro-readonly.profile touch ~/Videos/blablabla\r" |
164 | expect { | 164 | expect { |
165 | timeout {puts "TESTING ERROR 29\n";exit} | 165 | timeout {puts "TESTING ERROR 29\n";exit} |
166 | "Child process initialized" | 166 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
167 | } | 167 | } |
168 | expect { | 168 | expect { |
169 | timeout {puts "TESTING ERROR 30\n";exit} | 169 | timeout {puts "TESTING ERROR 30\n";exit} |