From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] 答复: 答复: [PATCH] ltp-aiodio/dio_append: fix dio_append()
Date: Fri, 4 Jun 2021 08:50:08 +0200 [thread overview]
Message-ID: <YLnNIHcZZEwT0CeM@pevik> (raw)
In-Reply-To: <60B9A3D1.1040001@fujitsu.com>
Hi Xu, Dong,
> Hi Dong
> > Hi xuyang
> > Thank you very much for your reply, but I think we should add the judgment of the return value in the "dio_append" function, because the final return value is 0 regardless of whether the test item passes or not, and 0 means PASS.
> IMO, I don't like perror or printf function and use return value to tell
> runltp that this case failed. LTP has tst_res() function with different
> flag and ltp new test framework can check pass/fail/conf number in
> lib/tst_test.c do_exit function.
+1
> A generic fix shound use tst_resm(TFAIL,) and tst_exit function.
> --- a/testcases/kernel/io/ltp-aiodio/dio_append.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
> @@ -85,7 +85,7 @@ void dio_append(char *filename)
> fd = open(filename, O_DIRECT | O_WRONLY | O_CREAT, 0666);
> if (fd < 0) {
> - perror("cannot create file");
> + tst_resm(TFAIL, "cannot create file %s", filename);
> return;
> }
> @@ -99,7 +99,7 @@ void dio_append(char *filename)
> memset(bufptr, 0, 64 * 1024);
> for (i = 0; i < 1000; i++) {
> if ((w = write(fd, bufptr, 64 * 1024)) != 64 * 1024) {
> - fprintf(stderr, "write %d returned %d\n", i, w);
> + tst_resm(TFAIL, "write %d returned %d", i, w);
> }
> }
> }
> @@ -139,5 +139,5 @@ int main(void)
> for (i = 0; i < num_children; i++) {
> kill(pid[i], SIGTERM);
> }
> - return 0;
> + tst_exit();
> }
> It also need sto use setup and cleanup function. But it is old test api.
> I guess we can use new api to do it.
> @Cyril, Petr, Li
> I think it is time to convert the whole ltp-aiodio cases into new api
+1. Although these tests fail on mainline, thus it's a question how to fix them.
Also they might are already covered in xfstests [1], it'd be better to ask in
fstests ML [2].
> and we still can use ltp-aiodio.sh.
If we decide to keep aiodio, it might be worth to tranform this somehow into
runltp-ng [3].
Kind regards,
Petr
[1] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/
[2] https://lore.kernel.org/fstests/
[3] https://github.com/metan-ucw/runltp-ng
> Best Regards
> Yang Xu
...
prev parent reply other threads:[~2021-06-04 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 7:57 [LTP] [PATCH] ltp-aiodio/dio_append: fix dio_append() dongshijiang
2021-06-03 10:04 ` xuyang2018.jy
2021-06-03 10:27 ` [LTP] 答复: " James Dong =?unknown-8bit?b?6JGj5LiW5rGf?=
2021-06-04 1:44 ` xuyang2018.jy
2021-06-04 2:37 ` [LTP] 答复: " James Dong =?unknown-8bit?b?6JGj5LiW5rGf?=
2021-06-04 3:53 ` xuyang2018.jy
2021-06-04 6:19 ` [LTP] 答复: " James Dong =?unknown-8bit?b?6JGj5LiW5rGf?=
2021-06-04 6:50 ` Petr Vorel [this message]
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=YLnNIHcZZEwT0CeM@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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.