ftruncate04.c: cleanup mandatory locking check
Hi,
The attached patch tries to cleanup the `mandatory locking' check in the ftruncate04.c testcase.
The currently test is made with system(2) and involve calling some external tools ... to determine if the underlying filesystem has `mand' option set. The same result can be easily retrieved with a simple statvfs(2) call and examining the mount flags value.
This has been successfully tested on a RHEL5 x86_64 machine.
Regards.
Signature · 4 lines
Nicolas Joly Biological Software and Databanks. Institut Pasteur, Paris.
testcases/kernel/syscalls/ftruncate/ftruncate04.c +9 -3
@@ -66,6 +66,8 @@#include <inttypes.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/mount.h> +#include <sys/statvfs.h> #include "test.h" #include "usctest.h" #include "libtestsuite.h"
@@ -285,6 +287,7 @@ int main(int ac, char **av)struct sigaction act;int lc;/* loop counter */ char *msg;/* message returned from parse_opts */ +struct statvfs fs;/* * parse standard options
@@ -300,9 +303,12 @@ int main(int ac, char **av) local_flag =PASSED ;tst_tmpdir (); -if (system - ("mount | grep `df . | grep ^/ | awk {'print $1'}` | grep mand >/dev/null" ) - !=0 ) { +if (statvfs ("." , &fs) ==-1 ) { +tst_resm (TFAIL |TERRNO ,"statvfs failed" ); +tst_rmdir (); +tst_exit (); + } +if ((fs.f_flag &MS_MANDLOCK ) ==0 ) {tst_resm (TCONF ,"The filesystem where /tmp is mounted does" " not support mandatory locks. Cannot run this test." );
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 5 lines · Nicolas Joly
Hi,
The attached patch tries to cleanup the `mandatory locking' check in the
ftruncate04.ctestcase.
Quoted 8 lines
The currently test is made with system(2) and involve calling some external tools ... to determine if the underlying filesystem has `mand' option set. The same result can be easily retrieved with a simple statvfs(2) call and examining the mount flags value.
This has been successfully tested on a RHEL5
x86_64machine.Signed-off-by Nicolas Joly <[email protected]>
Thanks. This does not introduce any regression. Will wait for others comments as well.
Regards--
Subrata
Quoted 9 lines
Regards.
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 5 lines · Nicolas Joly
Hi,
The attached patch tries to cleanup the `mandatory locking' check in the
ftruncate04.ctestcase.
Quoted 8 lines
The currently test is made with system(2) and involve calling some external tools ... to determine if the underlying filesystem has `mand' option set. The same result can be easily retrieved with a simple statvfs(2) call and examining the mount flags value.
This has been successfully tested on a RHEL5
x86_64machine.Signed-off-by Nicolas Joly <[email protected]>
Thanks.
Regards--
Subrata
Quoted 9 lines
Regards.
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list