From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/2] test: Slight simplification to pasta log tests
Date: Wed, 24 Apr 2024 14:29:59 +1000 [thread overview]
Message-ID: <20240424043000.1485776-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20240424043000.1485776-1-david@gibson.dropbear.id.au>
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>
---
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 fcdd5538..f1002167 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
--
@@ -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
--
2.44.0
next prev parent reply other threads:[~2024-04-24 4:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 4:29 [PATCH 0/2] Fixes for logging tests David Gibson
2024-04-24 4:29 ` David Gibson [this message]
2024-04-24 4:30 ` [PATCH 2/2] test: Make log truncation test more robust David Gibson
2024-04-24 22:01 ` Stefano Brivio
2024-04-24 22:02 ` [PATCH 0/2] Fixes for logging tests Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240424043000.1485776-2-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).