Hi: When I run ltp testcases (the latest version, JUNE 2012 STABLE :ltp-full-20120614),I find tow testcases are broken( mount2 and mount3 in " testcases/kernel/syscalls/mount" directory):
# ./mount02 -D /dev/loop2 -T ext3
mount02 1 TPASS : mount got expected failure: errno=ENODEV(19): No such
device
mount02 2 TPASS : mount got expected failure: errno=ENOTBLK(15): Block
device required
mount02 3 TPASS : mount got expected failure: errno=EBUSY(16): Device or
resource busy
mount02 4 TBROK : umount of mnt_18620 failed: errno=EBUSY(16): Device or
resource busy
mount02 5 TBROK : Remaining cases broken
mount02 0 TWARN : tst_rmdir: rmobj(/tmp/mouSyPao1) failed:
remove(/tmp/mouSyPao1/mnt_18620) failed; errno=16: Device or resource busy
# ./mount03 -D /dev/loop2 -T ext3
mount03 1 TBROK : stat for setuid_test failed
mount03 2 TBROK : Remaining cases broken
In mount02.c, the global array variable exp_enos is defined as :
static int exp_enos[] = { ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT,
ENAMETOOLONG, ENOENT, ENOTDIR, 0};
There are egiht items in the exp_enos, but the value of TST_TOTAL is 13, it
means there are 13 checkpoints int the testcase. As a result ,in the
setup_test function , there are 13 switch-cases ( case 0、case1 ... case 12)
But the number of the expect result in the exp_enos array is mismatch with the
number of checkpoint, so the TBROK happend.
In mount03.c, there are three issues:
1、In setup function, the setuid_test file is in the testhome_path instead of
the temporary directory Path_name. It results "stat for setuid_test failed"
2、In setup function, snprintf(Path_name, PATH_MAX, "%s/%s/", Path_name,
mntpoint), it can not implement appending the mntpoint string to the Path_name
string;
3、In test_rwflag function, in the part of "case 2"(at line 280 in mount03.c),
if the "execlp(file, basename(file), NULL)" will return (actually it will
return),
the return value of test_rwflag is always 1 (1 means fail),so the testcase
is always failed; Another hand, if it will not return (if kernel bug exists),
the process
will terminate unexpectedly.
I fix them in the patch (See the attachment), and both of the tow testcase can
get pass. Pls check the patch attachmented.
This e-mail and its attachments contain confidential information from HUAWEI,
which
is intended only for the person or entity whose address is listed above. Any
use of the
information contained herein in any way (including, but not limited to, total
or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify
the sender by
phone or email immediately and delete it!
fix_mount2_mount3_bug.patch
Description: fix_mount2_mount3_bug.patch
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
