> 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.
That seems to be correct. Could you please send signed patch against
latest LTP git? Ideally attached as well as inline (the best way to send
git patches is using the 'git send-email').
Also please check your coding style (which could be easily done by
checkpatch.pl script that is shipped with linux kernel sources).
> 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;
There is still quite a lot of unnecessary string handling. Couldn't the
whole setup be done with two or three snprintf()?
> 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'm not sure that I follow, but you changed execlp to system so that the
file gets executed in child and the return value gets passed to the
> I fix them in the patch (See the attachment), and both of the tow
> testcase can get pass. Pls check the patch attachmented.
And while you are looking at these files, there are several things that
could be fixed too. These tests should use tst_require_root(NULL)
instead of if (getuid() != 0). There are unnecessary casts for pointers
returned from malloc() and useless comments like /* this is loop counter */.
If you care enough to fix them, these should be ideally fixed in separate patch.