Hi all,

This patch fix the problem reported at bug "[ 1732287 ] mtest06/mmap1.c 
missing run_once check in do loop".

What happens here is that before release ltp-full-20070531, the test had a 
default value for how much time it'd run, but when you passed nothing to it 
it'd run for just one iteration, without working with the default value 
(that's 24 hours).

At the latest release, this was fixed but ltp runtest files is calling this 
test as before, passing nothing to it, and the test start running for 24 
hours (instead of just one time).

I had two options to fix this, one is ignoring the default run time and the 
other is fixing how we call the test at runtest files. I did the second one 
because sound more correct to me than the first one (the test is now running 
for 3 minutes at runtest/* files).

It has also a fix at the test output, also pointed by the bug.

Thanks,

-- 
Ricardo Salveti de Araujo
Fix mtest06/mmap1 test output and default run time at runtest/*
    
Bug 1732287.
    
Signed-off-by: Ricardo Salveti de Araujo <[EMAIL PROTECTED]>

diff --git a/runtest/ltplite b/runtest/ltplite
index b72eb43..05bcd5c 100644
--- a/runtest/ltplite
+++ b/runtest/ltplite
@@ -1007,7 +1007,7 @@ mtest01w mtest01 -p80 -w
 
 #test for race conditions
 mtest05 mmstress
-mtest06 mmap1
+mtest06 mmap1 -x 0.05
 
 mem01 mem01
 mem02 mem02
diff --git a/runtest/mm b/runtest/mm
index f549f0b..a4b6b61 100644
--- a/runtest/mm
+++ b/runtest/mm
@@ -14,7 +14,7 @@ mtest01w mtest01 -p80 -w
 
 #test for race conditions
 mtest05 mmstress
-mtest06 mmap1
+mtest06 mmap1 -x 0.05
 
 mem01 mem01
 mem02 mem02
diff --git a/runtest/stress.part1 b/runtest/stress.part1
index ef923d7..89f01dd 100644
--- a/runtest/stress.part1
+++ b/runtest/stress.part1
@@ -14,7 +14,7 @@ mtest01w mtest01 -p80 -w
 
 #test for race conditions
 mtest05 mmstress
-mtest06 mmap1
+mtest06 mmap1 -x 0.05
 
 mem02 mem02
 
diff --git a/testcases/kernel/mem/mtest06/mmap1.c b/testcases/kernel/mem/mtest06/mmap1.c
index 40cfbd5..c73f395 100644
--- a/testcases/kernel/mem/mtest06/mmap1.c
+++ b/testcases/kernel/mem/mtest06/mmap1.c
@@ -63,6 +63,12 @@
 /*                               we are done with the test - Paul Larson      */
 /*                               email:[EMAIL PROTECTED]             */
 /*								              */
+/*              Jun  - 12 - 2007 Modified - removing 'run_once', so the test  */
+/*                               can be run only with a time value (or the    */
+/*                               default one, 24 hours). Bug 1732287, pointed */
+/*                               by jerrywei.                                 */
+/*                               email:[EMAIL PROTECTED]            */
+/*								              */
 /* File: 	mmap1.c							      */
 /*									      */
 /* Description:	Test the LINUX memory manager. The program is aimed at        */
@@ -398,6 +404,8 @@ read_mem(void *args)		/* number of reads performed		      */
     long 	*rmargs = args;	/* local pointer to the arguments	      */
     volatile int exit_val = 0;  /* pthread exit value			      */
 
+    fprintf(stdout, "pid[%d] - read contents of memory %p %ld times\n",
+           getpid(), map_address, rmargs[2]);
     if (verbose_print)
         fprintf(stdout, 
 		"read_mem()arguments are:\n"
@@ -407,8 +415,6 @@ read_mem(void *args)		/* number of reads performed		      */
 
     while (rd_index++ < (int)rmargs[2])
     {
-        fprintf(stdout, "pid[%d] - read contents of memory %p %ld times\n",
-               getpid(), map_address, rmargs[2]);
         if (verbose_print)
 	    fprintf(stdout, 
 	        "read_mem() in while loop  %d times to go %ld times\n", 
@@ -500,7 +506,6 @@ main(int  argc,		/* number of input parameters.			      */
     int		 fd;		/* temporary file descriptor		      */
     int          status[2];     /* exit status for process X and Y	      */
     int          sig_ndx;      	/* index into signal handler structure.       */
-    int		 run_once = TRUE;/* run the test once time. (dont repeat)     */
     pthread_t    thid[2];	/* pids of process X and Y		      */
     long         chld_args[3];	/* arguments to funcs execed by child process */
     extern  char *optarg;	/* arguments passed to each option	      */
@@ -558,10 +563,8 @@ main(int  argc,		/* number of input parameters.			      */
 		if (exec_time == 0) 
 	     	    OPT_MISSING(argv[0], optopt);
 		else
-	             if (exec_time < 0) {
+	             if (exec_time < 0)
 				fprintf(stdout,"WARNING: bad argument. Using default %d\n", (exec_time = 24));
-			} else			
-				run_once = FALSE;
 		break;
 	    default :
 		usage(argv[0]);
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to