From 7578e86ef8ddb78da44d426b94def77366627e0e Mon Sep 17 00:00:00 2001 From: smitsohu Date: Wed, 9 Feb 2022 18:04:36 +0100 Subject: 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. --- test/profiles/ignore.exp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/profiles/ignore.exp') diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp index 7d13a8b72..df4337e1e 100755 --- a/test/profiles/ignore.exp +++ b/test/profiles/ignore.exp @@ -17,7 +17,7 @@ send -- "firejail --debug --ignore=seccomp\r" expect { timeout {puts "TESTING ERROR 1\n";exit} BLACKLIST {puts "TESTING ERROR 2\n";exit} - "Child process initialized" + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 send -- "exit\r" @@ -26,7 +26,7 @@ sleep 1 send -- "firejail --ignore=seccomp --ignore=shell --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "Child process initialized" + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -42,7 +42,7 @@ sleep 1 send -- "firejail --ignore=private --ignore=shell --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 5\n";exit} - "Child process initialized" + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -59,7 +59,7 @@ send -- "firejail --debug --profile=ignore2.profile\r" expect { timeout {puts "TESTING ERROR 7\n";exit} BLACKLIST {puts "TESTING ERROR 8\n";exit} - "Child process initialized" + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -69,7 +69,7 @@ sleep 1 send -- "firejail --ignore=quiet --ignore=shell --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 9\n";exit} - "Child process initialized" + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 -- cgit v1.2.3-54-g00ecf