Skip to contentSkip to conversation

fcntl16: Skip fcntl16 test block2 and block3 on NFS

PATCH In review Xiong Zhou 2 participants 5 messages Aug 22, 2014 – Sep 9, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Xiong Zhou

author
#1 lore raw

PATCH v4 3/3 fcntl16: Skip fcntl16 test block2 and block3 on NFS

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block2 and block3 if NFS.

---
 testcases/kernel/syscalls/fcntl/fcntl16.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl16.c +21 -6
index 44b6a80..67d3b17 100644
@@ -51,6 +51,8 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include "tst_fs_type.h"
+
 #define SKIPVAL 0x0f00
 //#define       SKIP    SKIPVAL, 0, 0L, 0L, IGNORED
 #define SKIP 0,0,0L,0L,0
@@ -62,6 +64,7 @@
 #define	NOBLOCK		2	/* immediate success */
 #define	WILLBLOCK	3	/* blocks, succeeds, parent unlocks records */
 #define	TIME_OUT	10
+int NO_NFS = 1;			/* Test on NFS or not */
 
 typedef struct {
 	struct flock parent_a;
@@ -412,6 +415,10 @@ void setup(void)
 
 	tst_tmpdir();
 
+	/* On NFS or not */
+	if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC)
+		NO_NFS = 0;
+
 	/* set up temp filename */
 	sprintf(tmpname, "fcntl4.%d", parent);
 
@@ -689,13 +696,17 @@ int main(int ac, char **av)
 		 * locking
 		 */
 		tst_resm(TINFO, "Entering block 2");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
 			     S_IRUSR | S_IWUSR, 0, 11)) {
 			tst_resm(TINFO, "Test case 2: with mandatory record "
 				 "locking FAILED");
 		} else {
-			tst_resm(TINFO, "Test case 2: with mandatory record "
-				 "locking PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 2: with mandatory"
+					 "record locking PASSED");
+			else
+				tst_resm(TCONF, "Test case 2: NFS does not"
+					 " support mandatory locking");
 		}
 		tst_resm(TINFO, "Exiting block 2");
 
@@ -705,13 +716,17 @@ int main(int ac, char **av)
 		 * and no delay
 		 */
 		tst_resm(TINFO, "Entering block 3");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
 			     S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) {
 			tst_resm(TINFO, "Test case 3: mandatory locking with "
 				 "NODELAY FAILED");
 		} else {
-			tst_resm(TINFO, "Test case 3: mandatory locking with "
-				 "NODELAY PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 3: mandatory"
+					 "locking with NODELAY PASSED");
+			else
+				tst_resm(TCONF, "Test case 3: NFS does not"
+					 " support mandatory locking");
 		}
 		tst_resm(TINFO, "Exiting block 3");
 	}
Signature · 11 lines
1.8.3.1


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Reviewed-by on v4 3/3
#2 lore raw
Quoted 6 lines · Xiong Zhou

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block2 and block3 if NFS.

---

The entire series looks good for me.

Just found removed spaces below, but there is no need to resend the patch/series because it can be fixed at commit time. :)

Thanks.

Quoted 40 lines
  testcases/kernel/syscalls/fcntl/fcntl16.c | 27 +++++++++++++++++++++------
  1 file changed, 21 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl16.c +7 -1
index 44b6a80..67d3b17 100644
@@ -51,6 +51,8 @@
  #include <sys/types.h>
  #include <sys/wait.h>
 
+#include "tst_fs_type.h"
+
  #define SKIPVAL 0x0f00
  //#define       SKIP    SKIPVAL, 0, 0L, 0L, IGNORED
  #define SKIP 0,0,0L,0L,0
@@ -62,6 +64,7 @@
  #define	NOBLOCK		2	/* immediate success */
  #define	WILLBLOCK	3	/* blocks, succeeds, parent unlocks records */
  #define	TIME_OUT	10
+int NO_NFS = 1;			/* Test on NFS or not */
 
  typedef struct {
  	struct flock parent_a;
@@ -412,6 +415,10 @@ void setup(void)
 
  	tst_tmpdir();
 
+	/* On NFS or not */
+	if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC)
+		NO_NFS = 0;
+
  	/* set up temp filename */
  	sprintf(tmpname, "fcntl4.%d", parent);
 
@@ -689,13 +696,17 @@ int main(int ac, char **av)
  		 * locking
  		 */
  		tst_resm(TINFO, "Entering block 2");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 706

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
  			     S_IRUSR | S_IWUSR, 0, 11)) {
  			tst_resm(TINFO, "Test case 2: with mandatory record "
  				 "locking FAILED");
  		} else {
-			tst_resm(TINFO, "Test case 2: with mandatory record "
-				 "locking PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 2: with mandatory"
+					 "record locking PASSED");

We need a space here

Quoted 11 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -1
+			else
+				tst_resm(TCONF, "Test case 2: NFS does not"
+					 " support mandatory locking");
  		}
  		tst_resm(TINFO, "Exiting block 2");
 
@@ -705,13 +716,17 @@ int main(int ac, char **av)
  		 * and no delay
  		 */
  		tst_resm(TINFO, "Entering block 3");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 726

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
  			     S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) {
  			tst_resm(TINFO, "Test case 3: mandatory locking with "
  				 "NODELAY FAILED");
  		} else {
-			tst_resm(TINFO, "Test case 3: mandatory locking with "
-				 "NODELAY PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 3: mandatory"
+					 "locking with NODELAY PASSED");

and here

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 732

Quoted 7 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -0
+			else
+				tst_resm(TCONF, "Test case 3: NFS does not"
+					 " support mandatory locking");
  		}
  		tst_resm(TINFO, "Exiting block 3");
  	}

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#3 lore raw

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block 1 if NFS.

---
 testcases/kernel/syscalls/fcntl/fcntl16.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl16.c +21 -6
index 44b6a80..5ba508c 100644
@@ -51,6 +51,8 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include "tst_fs_type.h"
+
 #define SKIPVAL 0x0f00
 //#define       SKIP    SKIPVAL, 0, 0L, 0L, IGNORED
 #define SKIP 0,0,0L,0L,0
@@ -62,6 +64,7 @@
 #define	NOBLOCK		2	/* immediate success */
 #define	WILLBLOCK	3	/* blocks, succeeds, parent unlocks records */
 #define	TIME_OUT	10
+int NO_NFS = 1;			/* Test on NFS or not */
 
 typedef struct {
 	struct flock parent_a;
@@ -412,6 +415,10 @@ void setup(void)
 
 	tst_tmpdir();
 
+	/* On NFS or not */
+	if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC)
+		NO_NFS = 0;
+
 	/* set up temp filename */
 	sprintf(tmpname, "fcntl4.%d", parent);
 
@@ -689,13 +696,17 @@ int main(int ac, char **av)
 		 * locking
 		 */
 		tst_resm(TINFO, "Entering block 2");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
 			     S_IRUSR | S_IWUSR, 0, 11)) {
 			tst_resm(TINFO, "Test case 2: with mandatory record "
 				 "locking FAILED");
 		} else {
-			tst_resm(TINFO, "Test case 2: with mandatory record "
-				 "locking PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 2: with mandatory"
+					 " record locking PASSED");
+			else
+				tst_resm(TCONF, "Test case 2: NFS does not"
+					 " support mandatory locking");
 		}
 		tst_resm(TINFO, "Exiting block 2");
 
@@ -705,13 +716,17 @@ int main(int ac, char **av)
 		 * and no delay
 		 */
 		tst_resm(TINFO, "Entering block 3");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
 			     S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) {
 			tst_resm(TINFO, "Test case 3: mandatory locking with "
 				 "NODELAY FAILED");
 		} else {
-			tst_resm(TINFO, "Test case 3: mandatory locking with "
-				 "NODELAY PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 3: mandatory"
+					 " locking with NODELAY PASSED");
+			else
+				tst_resm(TCONF, "Test case 3: NFS does not"
+					 " support mandatory locking");
 		}
 		tst_resm(TINFO, "Exiting block 3");
 	}
Signature · 5 lines
1.8.3.1



----- Original Message -----
Quoted 15 lines

From: "Stanislav Kholmanskikh" <[email protected]>
To: "Xiong Zhou" <[email protected]>, [email protected]
Sent: Monday, August 25, 2014 4:26:29 PM
Subject: Re: [LTP][PATCH v4 3/3] fcntl16: Skip fcntl16 test block2 and block3 on NFS

Quoted 6 lines · Xiong Zhou

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block2 and block3 if NFS.

---

Quoted 10 lines

The entire series looks good for me.

Just found removed spaces below, but there is no need to resend the patch/series because it can be fixed at commit time. :)

Thanks.

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
In reply to Stanislav Kholmanskikh

Hi.

Could anybody look at the series?

If there are no objections, I'm going to push it tomorrow.

Thanks.

Quoted 94 lines · Stanislav Kholmanskikh
Quoted 6 lines · Xiong Zhou

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block2 and block3 if NFS.

---

The entire series looks good for me.

Just found removed spaces below, but there is no need to resend the patch/series because it can be fixed at commit time. :)

Thanks.

Quoted 40 lines
   testcases/kernel/syscalls/fcntl/fcntl16.c | 27 +++++++++++++++++++++------
   1 file changed, 21 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl16.c +7 -1
index 44b6a80..67d3b17 100644
@@ -51,6 +51,8 @@
   #include <sys/types.h>
   #include <sys/wait.h>
 
+#include "tst_fs_type.h"
+
   #define SKIPVAL 0x0f00
   //#define       SKIP    SKIPVAL, 0, 0L, 0L, IGNORED
   #define SKIP 0,0,0L,0L,0
@@ -62,6 +64,7 @@
   #define	NOBLOCK		2	/* immediate success */
   #define	WILLBLOCK	3	/* blocks, succeeds, parent unlocks records */
   #define	TIME_OUT	10
+int NO_NFS = 1;			/* Test on NFS or not */
 
   typedef struct {
   	struct flock parent_a;
@@ -412,6 +415,10 @@ void setup(void)
 
   	tst_tmpdir();
 
+	/* On NFS or not */
+	if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC)
+		NO_NFS = 0;
+
   	/* set up temp filename */
   	sprintf(tmpname, "fcntl4.%d", parent);
 
@@ -689,13 +696,17 @@ int main(int ac, char **av)
   		 * locking
   		 */
   		tst_resm(TINFO, "Entering block 2");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 706

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
   			     S_IRUSR | S_IWUSR, 0, 11)) {
   			tst_resm(TINFO, "Test case 2: with mandatory record "
   				 "locking FAILED");
   		} else {
-			tst_resm(TINFO, "Test case 2: with mandatory record "
-				 "locking PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 2: with mandatory"
+					 "record locking PASSED");

We need a space here

Quoted 11 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -1
+			else
+				tst_resm(TCONF, "Test case 2: NFS does not"
+					 " support mandatory locking");
   		}
   		tst_resm(TINFO, "Exiting block 2");
 
@@ -705,13 +716,17 @@ int main(int ac, char **av)
   		 * and no delay
   		 */
   		tst_resm(TINFO, "Entering block 3");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 726

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
   			     S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) {
   			tst_resm(TINFO, "Test case 3: mandatory locking with "
   				 "NODELAY FAILED");
   		} else {
-			tst_resm(TINFO, "Test case 3: mandatory locking with "
-				 "NODELAY PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 3: mandatory"
+					 "locking with NODELAY PASSED");

and here

Quoted 17 lines

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 732

Quoted 7 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -0
+			else
+				tst_resm(TCONF, "Test case 3: NFS does not"
+					 " support mandatory locking");
   		}
   		tst_resm(TINFO, "Exiting block 3");
   	}

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
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

#5 lore raw
Quoted 5 lines · Stanislav Kholmanskikh

Hi.

Could anybody look at the series?

If there are no objections, I'm going to push it tomorrow.

Pushed.

Quoted 116 lines

Thanks.

Quoted 94 lines · Stanislav Kholmanskikh
Quoted 6 lines · Xiong Zhou

According to nfs(5), NLM supports advisory file locks only. So skip fcntl16 test block2 and block3 if NFS.

---

The entire series looks good for me.

Just found removed spaces below, but there is no need to resend the patch/series because it can be fixed at commit time. :)

Thanks.

Quoted 40 lines
    testcases/kernel/syscalls/fcntl/fcntl16.c | 27 +++++++++++++++++++++------
    1 file changed, 21 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl16.c +7 -1
index 44b6a80..67d3b17 100644
@@ -51,6 +51,8 @@
    #include <sys/types.h>
    #include <sys/wait.h>
 
+#include "tst_fs_type.h"
+
    #define SKIPVAL 0x0f00
    //#define       SKIP    SKIPVAL, 0, 0L, 0L, IGNORED
    #define SKIP 0,0,0L,0L,0
@@ -62,6 +64,7 @@
    #define	NOBLOCK		2	/* immediate success */
    #define	WILLBLOCK	3	/* blocks, succeeds, parent unlocks records */
    #define	TIME_OUT	10
+int NO_NFS = 1;			/* Test on NFS or not */
 
    typedef struct {
    	struct flock parent_a;
@@ -412,6 +415,10 @@ void setup(void)
 
    	tst_tmpdir();
 
+	/* On NFS or not */
+	if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC)
+		NO_NFS = 0;
+
    	/* set up temp filename */
    	sprintf(tmpname, "fcntl4.%d", parent);
 
@@ -689,13 +696,17 @@ int main(int ac, char **av)
    		 * locking
    		 */
    		tst_resm(TINFO, "Entering block 2");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 706

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID |
    			     S_IRUSR | S_IWUSR, 0, 11)) {
    			tst_resm(TINFO, "Test case 2: with mandatory record "
    				 "locking FAILED");
    		} else {
-			tst_resm(TINFO, "Test case 2: with mandatory record "
-				 "locking PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 2: with mandatory"
+					 "record locking PASSED");

We need a space here

Quoted 11 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -1
+			else
+				tst_resm(TCONF, "Test case 2: NFS does not"
+					 " support mandatory locking");
    		}
    		tst_resm(TINFO, "Exiting block 2");
 
@@ -705,13 +716,17 @@ int main(int ac, char **av)
    		 * and no delay
    		 */
    		tst_resm(TINFO, "Entering block 3");
-		if (run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 726

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +4 -2
+		if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY,
    			     S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) {
    			tst_resm(TINFO, "Test case 3: mandatory locking with "
    				 "NODELAY FAILED");
    		} else {
-			tst_resm(TINFO, "Test case 3: mandatory locking with "
-				 "NODELAY PASSED");
+			if (NO_NFS)
+				tst_resm(TINFO, "Test case 3: mandatory"
+					 "locking with NODELAY PASSED");

and here

Quoted 17 lines

testcases/kernel/syscalls/fcntl/fcntl16.c int main(int ac, char **av) · line 732

Quoted 7 lines
testcases/kernel/syscalls/fcntl/fcntl16.c +3 -0
+			else
+				tst_resm(TCONF, "Test case 3: NFS does not"
+					 " support mandatory locking");
    		}
    		tst_resm(TINFO, "Exiting block 3");
    	}

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Quoted 11 lines

------------------------------------------------------------------------------
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

------------------------------------------------------------------------------
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