-----Original Message----- From: Jan Stancek [mailto:[email protected]] Sent: Tuesday, February 25, 2014 7:28 PM To: [email protected] Cc: Francesco RUNDO; [email protected] Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
----- Original Message ----- > From: [email protected] > To: "Francesco RUNDO" <[email protected]> > Cc: "Jan Stancek" <[email protected]>, > [email protected] > Sent: Tuesday, 25 February, 2014 6:59:23 PM > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code > > Hi! Hi, > > > > > Now, "do_fallocate()" needs fallocate() op. but on ext3 this > > > > > is not supported i.e. ENOTSUP. > > > > > > >>Do you have kernel compiled with CONFIG_TMPFS=y? > > > > > > No. I've just checked kernel with above option: the reported > > > madvise03 testcase worked fine (usage of shmem_fallocate()). > > > So your analysis of my scenario is corret. > > > Please , discard posted patch. > > > > >>We can still handle this with some patch to skip first testcase if > > >>kernel is compiled without "CONFIG_TMPFS=y". I think that qualifies as > > >>TCONF. > > >>I'll leave it up to you. > > > > Hmmm....yes... as TCONF(and not TFAIL) is of course the right exit > > code in case of TMPFS not enabled on kernel side. > > I let you know... > > Generally LTP tests should handle gracefully when syscall returns > ENOSYS or ENOTSUP, in reality only cases that has been catched by > somebody are handled. > > What about following patch? For me your modified patch is ok. It covers scenario in which TCONF is right exit code instead of TFAIL. Thanks, BR FR >>I was thinking about trying to mount tmpfs, but that's probably unnecessary >>complication. >>Limiting it to MADV_REMOVE looks good and we have hint why it may happen: >>Reviewed-by: Jan Stancek <[email protected]> >># ./madvise03 >>madvise03 1 TCONF : madvise MADV_REMOVE returned ENOTSUP CONFIG_TMPFS=y >>not in kernel .config? >>madvise03 2 TPASS : madvise test for MADV_DONTFORK PASSED >>madvise03 3 TPASS : madvise test for MADV_DOFORK PASSED > > madvise/madvise03: Return TCONF on ENOTSUP > > If support for TMPFS (CONFIG_TMPFS) is not compiled in kernel madvise > will return ENOTSUP for these testcases. Return TCONF rather than > TFAIL int this case. > > Signed-off-by: Francesco Rundo <[email protected]> > Signed-off-by: Cyril Hrubis <[email protected]> > --- > testcases/kernel/syscalls/madvise/madvise03.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c > b/testcases/kernel/syscalls/madvise/madvise03.c > index aeae429..02b28d2 100644 > --- a/testcases/kernel/syscalls/madvise/madvise03.c > +++ b/testcases/kernel/syscalls/madvise/madvise03.c > @@ -157,6 +157,11 @@ static void cleanup(void) static void > check_and_print(char *advice) { > if (TEST_RETURN == -1) { > + if (TEST_ERRNO == ENOTSUP && !strcmp(advice, "MADV_REMOVE")) { > + tst_resm(TCONF, "madvise MADV_REMOVE returned ENOTSUP" > + " CONFIG_TMPFS=y not in kernel .config?"); > + return; > + } > tst_resm(TFAIL, > "madvise test for %s failed with " > "return = %ld, errno = %d : %s", > > -- > Cyril Hrubis > [email protected] > ------------------------------------------------------------------------------ Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis & security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
