All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/3] Make io_read() runtime-aware
Date: Wed, 14 Sep 2022 11:36:29 +0200	[thread overview]
Message-ID: <YyGgnY1e+CD2p9ws@yuki> (raw)
In-Reply-To: <20220913151907.26763-3-mdoucha@suse.cz>

Hi!
> diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
> index 88aec7952..595c76226 100644
> --- a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
> +++ b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
> @@ -188,7 +188,6 @@ static void cleanup(void)
>  static void run(void)
>  {
>  	char *filename = "file.bin";
> -	int status;
>  	int i, pid;
>  
>  	*run_child = 1;
> @@ -222,12 +221,10 @@ static void run(void)
>  		}
>  	}
>  
> -	if (SAFE_WAITPID(-1, &status, WNOHANG))
> -		tst_res(TFAIL, "Non zero bytes read");
> -	else
> -		tst_res(TPASS, "All bytes read were zeroed");
> -
>  	*run_child = 0;
> +
> +	if (!tst_validate_children(numchildren))
> +		tst_res(TPASS, "All bytes read were zeroed");

This actually breaks the test, have a look at the io_read() in common.h.
The code is written so that the child exits with zero if we find
non-zero bytes so the only way how to actually report a failure is to
check if any of the children did exit before we set the run_child to
zero.

Looking at the code closer the break actually breaks only the inner
for () loop, so it looks like the code was broken and is stil broken. I
guess that we should do return instead of break as well.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-09-14  9:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 15:19 [LTP] [PATCH 0/3] Fix ADSP074 timeouts Martin Doucha
2022-09-13 15:19 ` [LTP] [PATCH 1/3] Add tst_validate_children() helper function Martin Doucha
2022-09-14  9:12   ` Cyril Hrubis
2022-09-13 15:19 ` [LTP] [PATCH 2/3] Make io_read() runtime-aware Martin Doucha
2022-09-14  9:36   ` Cyril Hrubis [this message]
2022-09-13 15:19 ` [LTP] [PATCH 3/3] dio_sparse: Fix child exit code Martin Doucha
2022-09-14  9:37   ` Cyril Hrubis
2022-09-14  9:44     ` Martin Doucha
2022-09-14  9:49       ` Cyril Hrubis
2022-09-14  9:49         ` Martin Doucha

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=YyGgnY1e+CD2p9ws@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.