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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2024-04-24 14:29:59 +10:00 committed by Stefano Brivio
parent 0804fdbc28
commit 2681366966

View 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