On 05/31/2011 11:48 PM, Cyril Hrubis wrote: > Hi! >> cgroup filesystem is used in testcases oom03 and oom04, but cgroup >> filesystem is not supported in kernel older than 2.6.24. So we should >> check the kernel tag first. > > Still this doesn't help on kernels where cgroups are not compiled in. > > What about changing the mount_mem() to exit the test with TCONF when > mount() returned ENODEV. > Comment is followed, and here is the new patch. Thanks.:)
Signed-off-by: Tang Chen <[email protected]> --- testcases/kernel/mem/lib/mem.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index e679f1a..4d77408 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -256,8 +256,15 @@ void mount_mem(char *name, char *fs, char *options, char *path, char *path_new) { if (mkdir(path, 0777) == -1) tst_brkm(TBROK|TERRNO, cleanup, "mkdir %s", path); - if (mount(name, path, fs, 0, options) == -1) - tst_brkm(TBROK|TERRNO, cleanup, "mount %s", path); + if (mount(name, path, fs, 0, options) == -1) { + if (errno == ENODEV) { + if (rmdir(path) == -1) + tst_resm(TWARN|TERRNO, "rmdir %s", path); + tst_brkm(TCONF, NULL, "File system %s is not configured in kernel", fs); + } else { + tst_brkm(TBROK|TERRNO, cleanup, "mount %s", path); + } + } if (mkdir(path_new, 0777) == -1) tst_brkm(TBROK|TERRNO, cleanup, "mkdir %s", path_new); } -- 1.7.4 -- Best Regards, Tang chen ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
