* [PATCH] test/pasta_options: Ignore failures on shell 'exit'
@ 2023-02-13 1:12 Stefano Brivio
2023-02-13 2:30 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2023-02-13 1:12 UTC (permalink / raw)
To: passt-dev; +Cc: Paul Holzinger
On shell 'exit' commands, running shells from pasta, we might get:
Cannot set tty process group (No such process)
as some TTY devices might be unaccessible. This is harmless, but
after commit "pasta: propagate exit code from child command", we'll
get test failures there, at least with dash.
Ignore those explicitly with a ugly workaround: we can't simply do
something like:
exit || :
because the failure is reported by the shell itself once it exits,
regardless of the command evaluation.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
This is already applied, I needed to unblock tests. Posting anyway
for reviews.
test/pasta_options/log_to_file | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/pasta_options/log_to_file b/test/pasta_options/log_to_file
index 587bf8e..29fb2c8 100644
--- a/test/pasta_options/log_to_file
+++ b/test/pasta_options/log_to_file
@@ -34,12 +34,14 @@ set PORTS -t 10001,10002 -u 10001,10002
set LOG_FILE __STATEDIR__/pasta.log
passt ./pasta -l __LOG_FILE__
-passt exit
+passtb exit
+sleep 1
check [ -s __LOG_FILE__ ]
test Log truncated on creation
passt ./pasta -l __LOG_FILE__
-passt exit
+passtb exit
+sleep 1
check [ $(cat __LOG_FILE__ | wc -l) -eq 1 ]
test Maximum log size
@@ -85,6 +87,7 @@ check_log_size_mountns
test Timestamp consistency after rotations (no FALLOC_FL_COLLAPSE_RANGE)
check tail -n +2 __LOG_FILE__ | cut -f1 -d' ' | tr -d [.:] | sort -c
-passt exit
+passtb exit
+sleep 1
passt umount __STATEDIR__/t
passt exit
--
@@ -34,12 +34,14 @@ set PORTS -t 10001,10002 -u 10001,10002
set LOG_FILE __STATEDIR__/pasta.log
passt ./pasta -l __LOG_FILE__
-passt exit
+passtb exit
+sleep 1
check [ -s __LOG_FILE__ ]
test Log truncated on creation
passt ./pasta -l __LOG_FILE__
-passt exit
+passtb exit
+sleep 1
check [ $(cat __LOG_FILE__ | wc -l) -eq 1 ]
test Maximum log size
@@ -85,6 +87,7 @@ check_log_size_mountns
test Timestamp consistency after rotations (no FALLOC_FL_COLLAPSE_RANGE)
check tail -n +2 __LOG_FILE__ | cut -f1 -d' ' | tr -d [.:] | sort -c
-passt exit
+passtb exit
+sleep 1
passt umount __STATEDIR__/t
passt exit
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test/pasta_options: Ignore failures on shell 'exit'
2023-02-13 1:12 [PATCH] test/pasta_options: Ignore failures on shell 'exit' Stefano Brivio
@ 2023-02-13 2:30 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2023-02-13 2:30 UTC (permalink / raw)
To: Stefano Brivio; +Cc: passt-dev, Paul Holzinger
[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]
On Mon, Feb 13, 2023 at 02:12:12AM +0100, Stefano Brivio wrote:
> On shell 'exit' commands, running shells from pasta, we might get:
>
> Cannot set tty process group (No such process)
>
> as some TTY devices might be unaccessible. This is harmless, but
> after commit "pasta: propagate exit code from child command", we'll
> get test failures there, at least with dash.
>
> Ignore those explicitly with a ugly workaround: we can't simply do
> something like:
>
> exit || :
>
> because the failure is reported by the shell itself once it exits,
> regardless of the command evaluation.
>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> This is already applied, I needed to unblock tests. Posting anyway
> for reviews.
>
> test/pasta_options/log_to_file | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/test/pasta_options/log_to_file b/test/pasta_options/log_to_file
> index 587bf8e..29fb2c8 100644
> --- a/test/pasta_options/log_to_file
> +++ b/test/pasta_options/log_to_file
> @@ -34,12 +34,14 @@ set PORTS -t 10001,10002 -u 10001,10002
> set LOG_FILE __STATEDIR__/pasta.log
>
> passt ./pasta -l __LOG_FILE__
> -passt exit
> +passtb exit
> +sleep 1
> check [ -s __LOG_FILE__ ]
>
> test Log truncated on creation
> passt ./pasta -l __LOG_FILE__
> -passt exit
> +passtb exit
> +sleep 1
> check [ $(cat __LOG_FILE__ | wc -l) -eq 1 ]
>
> test Maximum log size
> @@ -85,6 +87,7 @@ check_log_size_mountns
> test Timestamp consistency after rotations (no FALLOC_FL_COLLAPSE_RANGE)
> check tail -n +2 __LOG_FILE__ | cut -f1 -d' ' | tr -d [.:] | sort -c
>
> -passt exit
> +passtb exit
> +sleep 1
> passt umount __STATEDIR__/t
> passt exit
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-13 3:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 1:12 [PATCH] test/pasta_options: Ignore failures on shell 'exit' Stefano Brivio
2023-02-13 2:30 ` David Gibson
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).