Hi ,

This is the patch for checking sysvipc enabled or not in the running
kernel version.
Please apply the patch with the latest ltp, i have checked for stability
with the new version of LTP.

Thanks
Rishi
This patch check the ipcns enabled with the running kernel version.

Signed-off By: [EMAIL PROTECTED]
Cc: "Serge E. Hallyn" <[EMAIL PROTECTED]>
--
 container_test.sh             |    8 +++++++-
 sysvipc/Makefile              |    2 +-
 sysvipc/check_ipcns_enabled.c |   41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 2 deletions(-)

Index: ltp-full-20070731/testcases/kernel/containers/sysvipc/Makefile
===================================================================
--- ltp-full-20070731.orig/testcases/kernel/containers/sysvipc/Makefile
+++ ltp-full-20070731/testcases/kernel/containers/sysvipc/Makefile
@@ -17,7 +17,7 @@ clean:
 	rm -f $(TARGETS) *.o $(NOLTP_TARGETS)
 
 install:
-	@set -e; for i in $(TARGETS) runipcnstest.sh ; do ln -f $$i ../../../bin/$$i ; chmod +x runipcnstest.sh ; done
+	@set -e; for i in $(TARGETS) runipcnstest.sh check_ipcns_enabled ; do ln -f $$i ../../../bin/$$i ; chmod +x runipcnstest.sh ; done
 
 noltp_check: noltp
 	./runtests_noltp.sh
Index: ltp-full-20070731/testcases/kernel/containers/container_test.sh
===================================================================
--- ltp-full-20070731.orig/testcases/kernel/containers/container_test.sh
+++ ltp-full-20070731/testcases/kernel/containers/container_test.sh
@@ -46,5 +46,11 @@ fi
 	#echo "User namespaces not enabled in kernel.  Not running userns tests."
 #fi
 
-runipcnstest.sh
+check_ipcns_enabled
+if [ $? -eq 0 ]; then
+	echo "Running ipcns tests."
+	runipcnstest.sh
+else
+	echo "ipc namespaces not enabled in kernel.  Not running pidns tests."
+fi
 
Index: ltp-full-20070731/testcases/kernel/containers/sysvipc/check_ipcns_enabled.c
===================================================================
--- /dev/null
+++ ltp-full-20070731/testcases/kernel/containers/sysvipc/check_ipcns_enabled.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 IBM
+ * Author: Rishikesh K Rajak <[EMAIL PROTECTED]>
+ *
+ */
+
+#include <sched.h>
+#include <stdio.h>
+#include "../libclone/libclone.h"
+#include "test.h"
+
+int dummy(void *v)
+{
+        return 0;
+}
+int main()
+{
+        void *childstack, *stack;
+        int pid;
+
+        if (tst_kvercmp(2,6,19) < 0)
+                return 1;
+        stack = malloc(getpagesize());
+        if (!stack) {
+                perror("malloc");
+                return 2;
+        }
+
+        childstack = stack + getpagesize();
+
+#ifdef __ia64__
+        pid = clone2(dummy, childstack, getpagesize(), CLONE_NEWIPC, NULL, NULL, NULL, NULL);
+#else
+        pid = clone(dummy, childstack, CLONE_NEWIPC, NULL);
+#endif
+
+        if (pid == -1) 
+                return 3;
+        return 0;
+}
+
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to