Skip to contentSkip to conversation

readlink03 test case fix

PATCH In review Nageswara R Sastry 2 participants 2 messages Sep 5, 2011 – Sep 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 readlink03 test case fix

In readlink03 testcase,
When 'Symlink Pathname is empty' the return value was 'ENOENT' but with newer kernels the return value is 'EINVAL'. The following patch will fix this.

readlink03:
Before patch:
...
readlink03 9 TFAIL : readlink() failed, Symlink Pathname is empty, errno=22, expected errno=2
...

After patch:
...

readlink03    9  TPASS  :  readlink(), Symlink Pathname is empty, returned errno 22
readlink03   10  TPASS  :  readlink(), Symlink Pathname is empty, returned errno 22

...

Signature · 2 lines
Regards
R.Nageswara Sastry
testcases/kernel/syscalls/readlink/readlink03.c +6 -2
@@ -172,7 +172,11 @@ int main(int ac, char **av)
 			if (buf_size == 1) {
 				buf_size = sizeof(buffer);
 			}
-
+                        if (strncmp(test_desc, "Symlink Pathname is empty", 25) == 0) {
+                                if ( tst_kvercmp(2,6,39) >= 0 || tst_kvercmp(3,0,0) >= 0 ) {
+                                        Test_cases[i].exp_errno = EINVAL;
+                                }
+                        }
 			/*
 			 * Call readlink(2) to test different test conditions.
 			 * verify that it fails with -1 return value and sets
@@ -358,4 +362,4 @@ void cleanup()
 
 	tst_rmdir();
 
-}
\ No newline at end of file
+}

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

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

#1 lore raw

Hi!

testcases/kernel/syscalls/readlink/readlink03.c int main(int ac, char **av) · line 176

Quoted 9 lines
testcases/kernel/syscalls/readlink/readlink03.c +2 -1
@@ -172,7 +172,11 @@ int main(int ac, char **av)
 			if (buf_size == 1) {
 				buf_size = sizeof(buffer);
 			}
-
+                        if (strncmp(test_desc, "Symlink Pathname is empty", 25) == 0) {
+                                if ( tst_kvercmp(2,6,39) >= 0 || tst_kvercmp(3,0,0) >= 0 ) {

There shouldn't be anything special about 3.0.0 as 3.0.0 is greater number than 2.6.39.

testcases/kernel/syscalls/readlink/readlink03.c void cleanup() · line 365

Quoted 13 lines
testcases/kernel/syscalls/readlink/readlink03.c +4 -1
+                                        Test_cases[i].exp_errno = EINVAL;
+                                }
+                        }
 			/*
 			 * Call readlink(2) to test different test conditions.
 			 * verify that it fails with -1 return value and sets
@@ -358,4 +362,4 @@ void cleanup()
 
 	tst_rmdir();
 
-}
\ No newline at end of file
+}

And please run through checkpatch.pl before resending.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list