fcntl14: only skip test block2 on NFS
PATCH 2/3 fcntl14: only skip test block2 on NFS
NFS does not support mandaroty locking.
--- testcases/kernel/syscalls/fcntl/fcntl14.c | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl14.c +27 -26
@@ -546,6 +546,7 @@ void catch_alarm(int sig);char *TCID ="fcntl14" ;int TST_TOTAL =1 ; +int NO_NFS =1 ;#ifdef UCLINUX static char *argv0;/* Set by main(), passed to self_exec() */
@@ -1000,10 +1001,9 @@ int main(int ac, char **av)setup ();/* global setup */ -if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) { -tst_brkm (TCONF , cleanup, -"Cannot do fcntl on a file on NFS filesystem" ); - } +/* Check if test on NFS or not*/ +if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) +NO_NFS =0 ;/* Check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -1027,30 +1027,31 @@ int main(int ac, char **av)tst_resm (TINFO ,"Exit block 1" );/* //block2: */ -tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); - fail =0 ;/* -* Try various locks on a file with mandatory record locking -* this should behave the same as an ordinary file +* Skip block2 if test on NFS, since NFS does not support +* mandatory locking */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,0 ,0 ,36 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 1 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 1 PASSED" ); - } - -/* Now try negative values for L_start and L_len */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,5 ,36 ,45 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 2 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 2 PASSED" ); - } - -tst_resm (TINFO ,"Exit block 2" ); +if (NO_NFS ) { +tst_resm (TINFO ,"Enter block 2: with" +" mandatory locking" ); + fail =0 ; +/* +* Try various locks on a file with mandatory +* record locking this should behave the same +* as an ordinary file +*/ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,0 ,0 ,36 ); +testcheck_end (fail,"Block 2, test 1" ); + +/* Now try negative values for L_start and L_len */ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,5 ,36 ,45 ); +testcheck_end (fail,"Block 2, test 2" ); + +tst_resm (TINFO ,"Exit block 2" ); + }else +tst_resm (TINFO ,"Skip block 2 on NFS" );/* //block3: */ tst_resm (TINFO ,"Enter block 3" );
Signature · 13 lines
1.8.3.1 ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 74 lines · Xiong Zhou
NFS does not support mandaroty locking.
Signed-off-by Xiong Zhou <[email protected]>--- testcases/kernel/syscalls/fcntl/fcntl14.c | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-)testcases/kernel/syscalls/fcntl/fcntl14.c +17
-26@@ -546,6 +546,7 @@ void catch_alarm(int sig);char *TCID ="fcntl14" ;int TST_TOTAL =1 ; +int NO_NFS =1 ;#ifdef UCLINUX static char *argv0;/* Set by main(), passed to self_exec() */ @@ -1000,10 +1001,9 @@ int main(int ac, char **av)setup ();/* global setup */ -if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) { -tst_brkm (TCONF , cleanup, -"Cannot do fcntl on a file on NFS filesystem" ); - } +/* Check if test on NFS or not*/ +if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) +NO_NFS =0 ;/* Check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {@@ -1027,30 +1027,31 @@ int main(int ac, char **av)tst_resm (TINFO ,"Exit block 1" );/* //block2: */ -tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); - fail =0 ;/* -* Try various locks on a file with mandatory record locking -* this should behave the same as an ordinary file +* Skip block2 if test on NFS, since NFS does not support +* mandatory locking */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,0 ,0 ,36 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 1 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 1 PASSED" ); - } - -/* Now try negative values for L_start and L_len */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,5 ,36 ,45 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 2 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 2 PASSED" ); - } - -tst_resm (TINFO ,"Exit block 2" ); +if (NO_NFS ) { +tst_resm (TINFO ,"Enter block 2: with" +" mandatory locking" ); + fail =0 ; +/* +* Try various locks on a file with mandatory +* record locking this should behave the same +* as an ordinary file +*/ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,0 ,0 ,36 );
testcases/kernel/syscalls/fcntl/fcntl14.c int main(int ac, char **av) · line 1054
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl14.c +10
-0+testcheck_end (fail,"Block 2, test 1" ); + +/* Now try negative values for L_start and L_len */ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,5 ,36 ,45 ); +testcheck_end (fail,"Block 2, test 2" ); + +tst_resm (TINFO ,"Exit block 2" ); + }else +tst_resm (TINFO ,"Skip block 2 on NFS" );
It's more a matter of taste, but recently in commit:
commit a2d860c854511cccd682ce244636cbb5f4b75d7c
Author: Xiong Zhou <[email protected]> Date: Tue Aug 26 03:01:26 2014 -0400
fcntl16: Skip fcntl16 test block2 and block3 on NFS
According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block 1 if NFS.
you changed the same skipping logic as:
tst_resm(TINFO, "Entering block bla")
if (NO_NFS) {
do_the_tests();
} else {
tst_resm(TCONF, "NFS does not support mandatory locking");
}tst_resm(TINFO, "Exiting block bla")
Maybe fix fcntl14.c using the same style?
And testcheck_end() to block 2 should be introduced in the previous patch.
Thanks.
testcases/kernel/syscalls/fcntl/fcntl14.c int main(int ac, char **av)
Quoted 4 lines
testcases/kernel/syscalls/fcntl/fcntl14.c +0
-0/* //block3: */ tst_resm (TINFO ,"Enter block 3" );
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH v2 2/3 fcntl14: only skip test block2 on NFS
NFS does not support mandaroty locking.
--- testcases/kernel/syscalls/fcntl/fcntl14.c | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl14.c +25 -25
@@ -546,6 +546,7 @@ void catch_alarm(int sig);char *TCID ="fcntl14" ;int TST_TOTAL =1 ; +int NO_NFS =1 ;#ifdef UCLINUX static char *argv0;/* Set by main(), passed to self_exec() */
@@ -1000,10 +1001,9 @@ int main(int ac, char **av)setup ();/* global setup */ -if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) { -tst_brkm (TCONF , cleanup, -"Cannot do fcntl on a file on NFS filesystem" ); - } +/* Check if test on NFS or not*/ +if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) +NO_NFS =0 ;/* Check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -1027,29 +1027,29 @@ int main(int ac, char **av)tst_resm (TINFO ,"Exit block 1" );/* //block2: */ -tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); - fail =0 ;/* -* Try various locks on a file with mandatory record locking -* this should behave the same as an ordinary file +* Skip block2 if test on NFS, since NFS does not support +* mandatory locking */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,0 ,0 ,36 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 1 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 1 PASSED" ); - } - -/* Now try negative values for L_start and L_len */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,5 ,36 ,45 ); -if (fail) { -tst_resm (TFAIL ,"Block 2, test 2 FAILED" ); - }else { -tst_resm (TPASS ,"Block 2, test 2 PASSED" ); - } - +tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); +if (NO_NFS ) { + fail =0 ; +/* +* Try various locks on a file with mandatory +* record locking this should behave the same +* as an ordinary file +*/ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,0 ,0 ,36 ); +testcheck_end (fail,"Block 2, test 1" ); + +/* Now try negative values for L_start and L_len */ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,5 ,36 ,45 ); +testcheck_end (fail,"Block 2, test 2" ); + }else +tst_resm (TCONF ,"Skip block 2 as NFS does not" +" support mandatory locking" );tst_resm (TINFO ,"Exit block 2" );/* //block3: */
Signature · 10 lines
1.8.3.1 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH v3 2/3 fcntl14: only skip test block2 on NFS
NFS does not support mandaroty locking.
--- testcases/kernel/syscalls/fcntl/fcntl14.c | 42 ++++++++++++++++++------------- 1 file changed, 25 insertions(+), 17 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl14.c +25 -17
@@ -546,6 +546,7 @@ void catch_alarm(int sig);char *TCID ="fcntl14" ;int TST_TOTAL =1 ; +int NO_NFS =1 ;#ifdef UCLINUX static char *argv0;/* Set by main(), passed to self_exec() */
@@ -1000,10 +1001,9 @@ int main(int ac, char **av)setup ();/* global setup */ -if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) { -tst_brkm (TCONF , cleanup, -"Cannot do fcntl on a file on NFS filesystem" ); - } +/* Check if test on NFS or not*/ +if (tst_fs_type (cleanup,"." ) ==TST_NFS_MAGIC ) +NO_NFS =0 ;/* Check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -1027,21 +1027,29 @@ int main(int ac, char **av)tst_resm (TINFO ,"Exit block 1" );/* //block2: */ -tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); - fail =0 ;/* -* Try various locks on a file with mandatory record locking -* this should behave the same as an ordinary file +* Skip block2 if test on NFS, since NFS does not support +* mandatory locking */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,0 ,0 ,36 ); -testcheck_end (fail,"Block 2, test 1" ); - -/* Now try negative values for L_start and L_len */ - (void )run_test (O_CREAT |O_RDWR |O_TRUNC ,S_ENFMT |S_IRUSR | -S_IWUSR ,5 ,36 ,45 ); -testcheck_end (fail,"Block 2, test 2" ); - +tst_resm (TINFO ,"Enter block 2: with mandatory locking" ); +if (NO_NFS ) { + fail =0 ; +/* +* Try various locks on a file with mandatory +* record locking this should behave the same +* as an ordinary file +*/ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,0 ,0 ,36 ); +testcheck_end (fail,"Block 2, test 1" ); + +/* Now try negative values for L_start and L_len */ + (void )run_test (O_CREAT |O_RDWR |O_TRUNC , +S_ENFMT |S_IRUSR |S_IWUSR ,5 ,36 ,45 ); +testcheck_end (fail,"Block 2, test 2" ); + }else +tst_resm (TCONF ,"Skip block 2 as NFS does not" +" support mandatory locking" );tst_resm (TINFO ,"Exit block 2" );/* //block3: */
Signature · 13 lines
1.8.3.1 ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list