public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] Fix the fork/11-1 conformance testcase
@ 2012-05-26 14:15 Garrett Cooper
  2012-05-27  7:33 ` Wanlong Gao
  0 siblings, 1 reply; 8+ messages in thread
From: Garrett Cooper @ 2012-05-26 14:15 UTC (permalink / raw)
  To: LTP list

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

The testcase tests to see whether or not locks are successfully
inherited across forking processes, as the requirements for fork state
that they should not be. The problem is that the test tests the negative
case for ftrylockfile (!= 0) instead of the positive case, which creates
an erroneous test failure as OUTPUT goes to /dev/stdout and the test
hangs.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
index ffff125..632b0db 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
@@ -85,7 +85,7 @@ void * threaded(void * arg)
        int ret;
        ret = ftrylockfile(stdout);

-       if (ret != 0)
+       if (ret == 0)
        {
                FAILED("The child process is owning the file lock.");
        }
@@ -168,4 +168,4 @@ int main(int argc, char * argv[])
 #endif

        PASSED;
-}
\ No newline at end of file
+}

[-- Attachment #2: 0001-Fix-the-fork-11-1-conformance-testcase.patch --]
[-- Type: application/octet-stream, Size: 1866 bytes --]

From 585537f7fa46be824d26b90d122472447f57cffc Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi@gmail.com>
Date: Sat, 26 May 2012 07:01:43 -0700
Subject: [PATCH] Fix the fork/11-1 conformance testcase
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.10.1"

This is a multi-part message in MIME format.
--------------1.7.10.1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


The testcase tests to see whether or not locks are successfully
inherited across forking processes, as the requirements for fork state
that they should not be. The problem is that the test tests the negative
case for ftrylockfile (!= 0) instead of the positive case, which creates
an erroneous test failure as OUTPUT goes to /dev/stdout and the test
hangs.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
---
 testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


--------------1.7.10.1
Content-Type: text/x-patch; name="0001-Fix-the-fork-11-1-conformance-testcase.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Fix-the-fork-11-1-conformance-testcase.patch"

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
index ffff125..632b0db 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c
@@ -85,7 +85,7 @@ void * threaded(void * arg)
 	int ret;
 	ret = ftrylockfile(stdout);
 
-	if (ret != 0)
+	if (ret == 0)
 	{
 		FAILED("The child process is owning the file lock.");
 	}
@@ -168,4 +168,4 @@ int main(int argc, char * argv[])
 #endif
 
 	PASSED;
-}
\ No newline at end of file
+}

--------------1.7.10.1--



[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-28  2:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-26 14:15 [LTP] [PATCH] Fix the fork/11-1 conformance testcase Garrett Cooper
2012-05-27  7:33 ` Wanlong Gao
2012-05-27  8:00   ` Garrett Cooper
2012-05-27  8:14     ` Wanlong Gao
2012-05-27  8:23       ` Garrett Cooper
2012-05-27  9:06         ` Wanlong Gao
2012-05-27 18:19           ` Garrett Cooper
2012-05-28  2:26             ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox