LTP test cases kill05 is broken on uclinux platform.

--
root:/bin> kill05
kill05      1  BROK  :  self_exec of child failed
kill05      0  INFO  :  WARNING: shared memory deletion failed.
kill05      0  INFO  :  This could lead to IPC resource problems.
kill05      0  INFO  :  id = 0
kill05      2  PASS  :  errno set to 1 : Operation not permitted, as
expected
kill05      0  WARN  :  tst_rmdir(): rmobj(/tmp/kilhsxPSp) failed:
lstat(/tmp/kilhsxPSp) failed; errno=2: No such file or directory
root:/bin>
--

Bellow is the fix for uclinux platform. And the permission of kill05 should
be set to be executable by every user.
--
Index: testcases/kernel/syscalls/kill/kill05.c
===================================================================
--- testcases/kernel/syscalls/kill/kill05.c
+++ testcases/kernel/syscalls/kill/kill05.c
@@ -84,12 +84,19 @@
 void cleanup(void);
 void setup(void);
 void do_child(void);
+#ifdef UCLINUX
+void uclinux_child(void);
+#endif
 void do_master_child(char **av);

 char *TCID = "kill05";
 int TST_TOTAL = 1;
 int shmid1 = -1;
+#ifdef UCLINUX
+static key_t semkey = 1234;
+#else
 extern key_t semkey;
+#endif
 int *flag;

 int exp_enos[] = { EPERM, 0 };
@@ -110,7 +117,7 @@
                tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
        }
 #ifdef UCLINUX
-       maybe_run_child(&do_child, "");
+       maybe_run_child(&uclinux_child, "");
 #endif

        setup();                /* global setup */
@@ -239,6 +246,29 @@
        }
 }

+#ifdef UCLINUX
+void
+uclinux_child()
+{
+       if ((shmid1 = shmget(semkey, (int)getpagesize(),
+             0666|IPC_CREAT)) == -1) {
+               tst_brkm(TBROK, cleanup, "uclinux_child: Failed to setup
shared memory");
+       }
+
+       if ((flag = (int *)shmat(shmid1, 0, 0)) == (int *)-1) {
+               tst_brkm(TBROK, cleanup,
+                       "uclinux_child: Failed to attatch shared memory:%d",
flag);
+       }
+       while(1) {
+               if (*flag == 1) {
+                       shmdt(flag);
+                       exit(0);
+               } else
+                       sleep (1);
+       }
+}
+#endif
+
 /*
  * setup() - performs all ONE TIME setup for this test
  */
@@ -257,8 +287,10 @@
         */
        tst_tmpdir();

+#ifndef UCLINUX
        /* get an IPC resource key */
        semkey = getipckey();
+#endif

        if ((shmid1 = shmget(semkey, (int)getpagesize(),
                             0666 | IPC_CREAT)) == -1) {
--



Best regards,
Vivi Li
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to