From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Xu Date: Tue, 29 Sep 2020 15:41:34 +0800 Subject: [LTP] [PATCH 1/1] io_destroy01: TCONF when unsupported In-Reply-To: <20200929073501.4598-1-pvorel@suse.cz> References: <20200929073501.4598-1-pvorel@suse.cz> Message-ID: <5F72E52E.40609@cn.fujitsu.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it Hi Petr Why not using kconfig in tst_test struct. Best Regards Yang Xu > to fix test on kernel built without CONFIG_AIO=y. > > Cleanup: use return instead of else, join string. > > Signed-off-by: Petr Vorel > --- > Hi, > > simple patch, but can wait after release. > I can move cleanup into separate commit. > > Kind regards, > Petr > > testcases/kernel/syscalls/io_destroy/io_destroy01.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/testcases/kernel/syscalls/io_destroy/io_destroy01.c b/testcases/kernel/syscalls/io_destroy/io_destroy01.c > index 560d7b3fb..5c5c59335 100644 > --- a/testcases/kernel/syscalls/io_destroy/io_destroy01.c > +++ b/testcases/kernel/syscalls/io_destroy/io_destroy01.c > @@ -32,14 +32,19 @@ static void verify_io_destroy(void) > return; > } > > + if (TST_RET == -ENOSYS) { > + tst_res(TCONF, "io_destroy() not supported"); > + return; > + } > + > if (TST_RET == -EINVAL) { > tst_res(TPASS, > "io_destroy() failed as expected, returned -EINVAL"); > - } else { > - tst_res(TFAIL, "io_destroy() failed unexpectedly, " > - "returned -%s expected -EINVAL", > - tst_strerrno(-TST_RET)); > + return; > } > + > + tst_res(TFAIL, "io_destroy() failed unexpectedly, returned -%s expected -EINVAL", > + tst_strerrno(-TST_RET)); > } > > static struct tst_test test = {