From 2681366966e3158ccdcd4a13ecc3978b6ba06459 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 24 Apr 2024 14:29:59 +1000 Subject: [PATCH] test: Slight simplification to pasta log tests test/pasta_options/log_to_file contains a couple of rudimentary tests where we start pasta with an interactive shell, then immediately exit it. We can achieve the same thing by using /bin/true as the command to pasta. This also means that waiting for pasta to start, waiting for the executed command to complete and for pasta to clean up are all handled by simply waiting for pasta to complete in the foreground, so there's no need for an additional sleep. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- test/pasta_options/log_to_file | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/pasta_options/log_to_file b/test/pasta_options/log_to_file index fcdd553..f100216 100644 --- a/test/pasta_options/log_to_file +++ b/test/pasta_options/log_to_file @@ -33,15 +33,11 @@ test Log creation set PORTS -t 10001,10002 -u 10001,10002 set LOG_FILE __STATEDIR__/pasta.log -passt ./pasta -l __LOG_FILE__ -passtb exit -sleep 1 +passt ./pasta -l __LOG_FILE__ -- /bin/true check [ -s __LOG_FILE__ ] test Log truncated on creation -passt ./pasta -l __LOG_FILE__ -passtb exit -sleep 1 +passt ./pasta -l __LOG_FILE__ -- /bin/true check [ $(cat __LOG_FILE__ | wc -l) -eq 1 ] test Maximum log size