Skip to contentSkip to conversation

Fix the splice02 test

PATCH Subrata Modak 2 participants 3 messages May 15, 2009 – May 18, 2009 2 messages 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]

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

#2 lore raw
Quoted 76 lines · CAI Qian

From: Jiri Palecek <[email protected]>
Subject: [LTP] [PATCH] Fix the splice02 test
Date: Wed, 13 May 2009 00:34:15 +0200

Quoted 72 lines

Particularly:

- TEST_ERRNO is only set when the syscall is executed using the TEST() macro. The tests gave bad error messages because of that.

- The end of the test was dead code; moved the TPASS code to pass at the end of file.

- The test assumes std. input is a pipe; reflect this in the runtest file

Regards
Jiri Palecek

---
  runtest/syscalls                            |    2 +-
  testcases/kernel/syscalls/splice/splice02.c |   16 ++++++----------
  2 files changed, 7 insertions(+), 11 deletions(-)
runtest/syscalls +1 -1
index 9b7b2ca..33beff0 100644
@@ -1033,7 +1033,7 @@ sockioctl01 sockioctl01
   #splice test
  splice01 splice01
-splice02 echo "Test splice02()" > splice02-temp; splice02 splice02-temp
+splice02 seq 1 10000000 | splice02 splice02-temp
   tee01 tee01
  diff --git a/testcases/kernel/syscalls/splice/splice02.c 

b/testcases/kernel/syscalls/splice/splice02.c
index 321d002..16bff86 100644

testcases/kernel/syscalls/splice/splice02.c +0 -1
@@ -108,7 +108,6 @@ void setup() {
   int main(int ac, char **av) {
  	int fd = 0;
-	int ret = 0;
 
          setup();
  @@ -118,26 +117,23 @@ int main(int ac, char **av) {
  	}

fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); if(fd < 0 ) {
- tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO,
strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +1 -0
+		tst_resm(TFAIL, "open(%s) failed - errno = %d : %s", av[1], errno, 

strerror(errno));
cleanup();
tst_exit();
}

          do {
testcases/kernel/syscalls/splice/splice02.c +0 -3
-	    ret = splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0);
-	    if (ret < 0) {
-            	tst_resm(TFAIL, "%s failed - errno = %d : %s",TCID, TEST_ERRNO, 

strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +3 -0
+					TEST(splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0));
+	    if (TEST_RETURN < 0) {
+            	tst_resm(TFAIL, "splice failed - errno = %d : %s", TEST_ERRNO, 

strerror(TEST_ERRNO));
cleanup();
tst_exit();
} else

testcases/kernel/syscalls/splice/splice02.c +2 -1
-            if (ret < SPLICE_SIZE){
+            if (TEST_RETURN == 0){
+							tst_resm(TPASS, "splice() system call Passed");
  	        cleanup();
  	        tst_exit();
  	    }
  	} while(1);
Quoted 8 lines

testcases/kernel/syscalls/splice/splice02.c

Quoted 6 lines
testcases/kernel/syscalls/splice/splice02.c +0 -4
-
-	close(fd);
-        tst_resm(TPASS, "splice() system call Passed");
-        tst_exit();
  }
  -- 1.6.2

Can't apply this patch -- long lines are wrapped. Please re-send it.

True. Here i get:

ERROR: patch seems to be corrupt (line wrapped?) #131: FILE: runtest/syscalls:1037:
b/testcases/kernel/syscalls/splice/splice02.c
total: 1 errors, 0 warnings, 16 lines checked

and

patching file runtest/syscalls
patch: **** malformed patch at line 131:
b/testcases/kernel/syscalls/splice/splice02.c

Regards--
Subrata

Quoted 12 lines

CAI Qian

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to a message not in the archive
Quoted 79 lines · CAI Qian

From: Jiri Palecek <[email protected]>
Subject: [LTP] [PATCH] Fix the splice02 test
Date: Wed, 13 May 2009 00:34:15 +0200

Quoted 75 lines

Particularly:

- TEST_ERRNO is only set when the syscall is executed using the TEST() macro. The tests gave bad error messages because of that.

- The end of the test was dead code; moved the TPASS code to pass at the end of file.

- The test assumes std. input is a pipe; reflect this in the runtest file

Regards
Jiri Palecek

---
  runtest/syscalls                            |    2 +-
  testcases/kernel/syscalls/splice/splice02.c |   16 ++++++----------
  2 files changed, 7 insertions(+), 11 deletions(-)
runtest/syscalls +1 -1
index 9b7b2ca..33beff0 100644
@@ -1033,7 +1033,7 @@ sockioctl01 sockioctl01
   #splice test
  splice01 splice01
-splice02 echo "Test splice02()" > splice02-temp; splice02 splice02-temp
+splice02 seq 1 10000000 | splice02 splice02-temp
   tee01 tee01
  diff --git a/testcases/kernel/syscalls/splice/splice02.c

b/testcases/kernel/syscalls/splice/splice02.c
index 321d002..16bff86 100644

testcases/kernel/syscalls/splice/splice02.c +0 -1
@@ -108,7 +108,6 @@ void setup() {
   int main(int ac, char **av) {
  	int fd = 0;
-	int ret = 0;
 
          setup();
  @@ -118,26 +117,23 @@ int main(int ac, char **av) {
  	}

fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); if(fd < 0 ) {
- tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID,
TEST_ERRNO,
strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +1 -0
+		tst_resm(TFAIL, "open(%s) failed - errno = %d : %s", av[1], errno,

strerror(errno));
cleanup();
tst_exit();
}

          do {
testcases/kernel/syscalls/splice/splice02.c +0 -3
-	    ret = splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0);
-	    if (ret < 0) {
-            	tst_resm(TFAIL, "%s failed - errno = %d : %s",TCID,  

TEST_ERRNO,
strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +3 -0
+					TEST(splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0));
+	    if (TEST_RETURN < 0) {
+            	tst_resm(TFAIL, "splice failed - errno = %d : %s",  

TEST_ERRNO,
strerror(TEST_ERRNO));
cleanup();
tst_exit();
} else

testcases/kernel/syscalls/splice/splice02.c +2 -1
-            if (ret < SPLICE_SIZE){
+            if (TEST_RETURN == 0){
+							tst_resm(TPASS, "splice() system call Passed");
  	        cleanup();
  	        tst_exit();
  	    }
  	} while(1);
Quoted 8 lines

testcases/kernel/syscalls/splice/splice02.c

Quoted 6 lines
testcases/kernel/syscalls/splice/splice02.c +0 -4
-
-	close(fd);
-        tst_resm(TPASS, "splice() system call Passed");
-        tst_exit();
  }
  -- 1.6.2

Can't apply this patch -- long lines are wrapped. Please re-send it.

It seems not to be caused by wrapped lines - I can still see them in the digest. However, some empty lines seem to be lost.

Anyway, it should be better now (see attachment).

Regards
Jiri Palecek

From 140bfb4eaeca73e407f6a2c65a7ea2d0cb80fd38 Mon Sep 17 00:00:00 2001
From: Jiri Palecek <[email protected]>
Date: Tue, 12 May 2009 18:50:10 +0200
Subject: [PATCH] Fix the splice02 test
Cc: "[email protected]" <[email protected]>

Particularly:

- TEST_ERRNO is only set when the syscall is executed using the TEST() macro. The tests gave bad error messages because of that.

- The end of the test was dead code; moved the TPASS code to pass at the end of file.

- The test assumes std. input is a pipe; reflect this in the runtest file

---
 runtest/syscalls                            |    2 +-
 testcases/kernel/syscalls/splice/splice02.c |   16 ++++++----------
 2 files changed, 7 insertions(+), 11 deletions(-)
runtest/syscalls +1 -1
index 9b7b2ca..33beff0 100644
@@ -1033,7 +1033,7 @@ sockioctl01 sockioctl01
 
 #splice test
 splice01 splice01
-splice02 echo "Test splice02()" > splice02-temp; splice02 splice02-temp
+splice02 seq 1 10000000 | splice02 splice02-temp
 
 tee01 tee01
 
testcases/kernel/syscalls/splice/splice02.c +6 -10
index 321d002..16bff86 100644
@@ -108,7 +108,6 @@ void setup() {
 
 int main(int ac, char **av) {
 	int fd = 0;
-	int ret = 0;
 	
         setup();
 
@@ -118,26 +117,23 @@ int main(int ac, char **av) {
 	}
 	fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	if(fd < 0 ) {
-           tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+		tst_resm(TFAIL, "open(%s) failed - errno = %d : %s", av[1], errno, strerror(errno));
 	   cleanup();
 	   tst_exit();
 	}
 			
         do {
-	    ret = splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0);
-	    if (ret < 0) {
-            	tst_resm(TFAIL, "%s failed - errno = %d : %s",TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+					TEST(splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0));
+	    if (TEST_RETURN < 0) {
+            	tst_resm(TFAIL, "splice failed - errno = %d : %s", TEST_ERRNO, strerror(TEST_ERRNO));
 	        cleanup();
 		tst_exit();
 	    } else
-            if (ret < SPLICE_SIZE){
+            if (TEST_RETURN == 0){
+							tst_resm(TPASS, "splice() system call Passed");
 	        cleanup();
 	        tst_exit();
 	    }
 	} while(1);
-
-	close(fd);
-        tst_resm(TPASS, "splice() system call Passed");
-        tst_exit();
 }
 
Signature · 1 line
1.6.2

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
Quoted 90 lines · Jiří Paleček
Quoted 79 lines · CAI Qian

From: Jiri Palecek <[email protected]>
Subject: [LTP] [PATCH] Fix the splice02 test
Date: Wed, 13 May 2009 00:34:15 +0200

Quoted 75 lines

Particularly:

- TEST_ERRNO is only set when the syscall is executed using the TEST() macro. The tests gave bad error messages because of that.

- The end of the test was dead code; moved the TPASS code to pass at the end of file.

- The test assumes std. input is a pipe; reflect this in the runtest file

Regards
Jiri Palecek

---
  runtest/syscalls                            |    2 +-
  testcases/kernel/syscalls/splice/splice02.c |   16 ++++++----------
  2 files changed, 7 insertions(+), 11 deletions(-)
runtest/syscalls +1 -1
index 9b7b2ca..33beff0 100644
@@ -1033,7 +1033,7 @@ sockioctl01 sockioctl01
   #splice test
  splice01 splice01
-splice02 echo "Test splice02()" > splice02-temp; splice02 splice02-temp
+splice02 seq 1 10000000 | splice02 splice02-temp
   tee01 tee01
  diff --git a/testcases/kernel/syscalls/splice/splice02.c

b/testcases/kernel/syscalls/splice/splice02.c
index 321d002..16bff86 100644

testcases/kernel/syscalls/splice/splice02.c +0 -1
@@ -108,7 +108,6 @@ void setup() {
   int main(int ac, char **av) {
  	int fd = 0;
-	int ret = 0;
 
          setup();
  @@ -118,26 +117,23 @@ int main(int ac, char **av) {
  	}

fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); if(fd < 0 ) {
- tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID,
TEST_ERRNO,
strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +1 -0
+		tst_resm(TFAIL, "open(%s) failed - errno = %d : %s", av[1], errno,

strerror(errno));
cleanup();
tst_exit();
}

          do {
testcases/kernel/syscalls/splice/splice02.c +0 -3
-	    ret = splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0);
-	    if (ret < 0) {
-            	tst_resm(TFAIL, "%s failed - errno = %d : %s",TCID,  

TEST_ERRNO,
strerror(TEST_ERRNO));

testcases/kernel/syscalls/splice/splice02.c +3 -0
+					TEST(splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0));
+	    if (TEST_RETURN < 0) {
+            	tst_resm(TFAIL, "splice failed - errno = %d : %s",  

TEST_ERRNO,
strerror(TEST_ERRNO));
cleanup();
tst_exit();
} else

testcases/kernel/syscalls/splice/splice02.c +2 -1
-            if (ret < SPLICE_SIZE){
+            if (TEST_RETURN == 0){
+							tst_resm(TPASS, "splice() system call Passed");
  	        cleanup();
  	        tst_exit();
  	    }
  	} while(1);
Quoted 8 lines

testcases/kernel/syscalls/splice/splice02.c int main(int ac, char **av) {

Quoted 6 lines
testcases/kernel/syscalls/splice/splice02.c +0 -4
-
-	close(fd);
-        tst_resm(TPASS, "splice() system call Passed");
-        tst_exit();
  }
  -- 1.6.2

Can't apply this patch -- long lines are wrapped. Please re-send it.

Quoted 4 lines

It seems not to be caused by wrapped lines - I can still see them in the digest. However, some empty lines seem to be lost.

Anyway, it should be better now (see attachment).

Thanks.

Regards--
Subrata

Quoted 8 lines

Regards
Jiri Palecek
------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list