From: Rishi k. K R. <ris...@li...> - 2010-04-29 13:10:38
|
The branch, next, has been updated via 4e08cd4291e660558504841323f0ac9869628327 (commit) via 049cbb9bee94cacc8b90b607cc5438a250224dd2 (commit) via 0fe72e731426061a4923ecfd9aa77879607f41a0 (commit) via acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 (commit) via c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef (commit) via d9f3d25b9db35073c7104b759d526869d9867692 (commit) via 23e7806fec4c6be42fdf577559df5498cce45118 (commit) via 5162b710bfc574107d915093c08b198f0a15727e (commit) via d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 (commit) via 1c9ec5ec1389062a4a091fee7295b36a6583df5d (commit) via 4837fee8a7c2de6a83c8927a574c792ca6dabe4e (commit) via f1922fb747b6df0bacd90c72daa748ff879b1fd8 (commit) via 44fba94453ca4f446cde4db08b0a760862b55cfa (commit) via aca4428b38701e46e0da38fd7583028216c32c66 (commit) via d2a9b9d3e04807fb4744dc7e778fe6e0c9543bc1 (commit) via bc7b5a1c1269f6626defed23b027dc3ec497a0c9 (commit) via 26fa8bb10113a92ca80a0e52fb4eded103fab565 (commit) from adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 (commit) - Log ----------------------------------------------------------------- commit 4e08cd4291e660558504841323f0ac9869628327 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 18:37:18 2010 +0530 I've been playing with patch from Jiri that attempts to fix ftest03 and ftest07 segfault and find out that it was correct however was done against some older ltp version. Attached patch is rebased against current git repository as well as tested to fix this issue on SLES11. Some background: The only poissonned line in ftest03.c, respective ftest07.c is: sprintf(fuss, "%s/ftest03.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); Where we are trying to fill path to the current working directory into fuss that is declared as 'char fuss[40];'. However it's better to remove all code to creates temporary directory from these tests as this is allready done by tst_tmpdir(). There is still a lot of duplicated/broken code in these tests but for simplicity I will address them in separate patches (so that it's easier to review them). Signed-off-by: Cyril Hrubis ch...@su... commit 049cbb9bee94cacc8b90b607cc5438a250224dd2 Merge: 0fe72e731426061a4923ecfd9aa77879607f41a0 f1922fb747b6df0bacd90c72daa748ff879b1fd8 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:50:36 2010 +0530 Merge branch 'maint' into next commit 0fe72e731426061a4923ecfd9aa77879607f41a0 Merge: acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 1c9ec5ec1389062a4a091fee7295b36a6583df5d Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:50:30 2010 +0530 Merge branch 'pu' into next commit acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 Merge: adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:48:45 2010 +0530 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: doc/MaintNotes | 107 +++++++++++++++++++++++ runltp | 2 +- testcases/kernel/fs/ftest/ftest01.c | 42 +-------- testcases/kernel/fs/ftest/ftest03.c | 62 +++----------- testcases/kernel/fs/ftest/ftest05.c | 45 +--------- testcases/kernel/fs/ftest/ftest07.c | 64 +++----------- testcases/kernel/syscalls/ipc/msgctl/msgctl10.c | 8 +-- testcases/kernel/syscalls/linkat/linkat01.c | 2 +- testcases/realtime/func/prio-wake/prio-wake.c | 11 +-- testscripts/test_fs_bind.sh | 2 +- 10 files changed, 149 insertions(+), 196 deletions(-) create mode 100644 doc/MaintNotes diff --git a/doc/MaintNotes b/doc/MaintNotes new file mode 100644 index 0000000..d89eba6 --- /dev/null +++ b/doc/MaintNotes @@ -0,0 +1,107 @@ +Welcome to ltp community. + +We are in process of changing our sf.net host repository to +GIT from CVS.[ Any input/discussion on this is highly appreciable ]. If +possible this month end release may get delayed based on responses from +list or next month end (i.e: March ) release will be based on git tree. + +I usually try to read all patches posted to ltp mailing list, and follow +almost all discussions on list, unless the topic is about an obscure +corner that i do not personally use. But i am obviously not perfect.If +you sent a patch that you did not hear from anybody for three days, +that is a very good indication that it was dropped on the floor --- please +do not hesitate to remind me. + +The list archive is available at: + +http://marc.info/?l=ltp-list&r=1&w=2 + + +Please use this public site to point out messages in mailing list if you +want to remind someone or again start same thread without altering +subject line. + +Now coming to git transformation this month, you can find gitweb +interface at : + +http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp-dev.git;a=summary + +There are four branches in ltp-dev.git repository that track the source tree +of ltp: "master", "maint", "next", "pu". I may add more maintanance +branch if we have huge backward of incompatible feature updates in the +future to keep an older release alive. + +The master branch is meant to contain what are very well tested and +ready to be used in production environment. There could occassionaly be +minor breakage but they are not expected to be anything major, and more +importantly those will be quickly and trivially fixable. + +So if some hotfixes has gone with this branch, you can find one more +digit has been added to version release (e.g: YYYYMMDD.1 ), So it means +it is more stable than YYYYMMDD release. I may be changing this format +if i can see a better format or if you have some suggestion then it is +most welcome. + +The "maint" branch is called one step before master branch, which will +contain all features or patches that are going to following month end +release. +(e.g: If this month end ltp-full-YYYYMMDD is going be to released +then all the stable patches you can find in this branch through out the +month, and one important point for this branch is all the patches which +has gone to this branch will be well tested and make sure that there is +no regression or breakage and Acked/Reviewed by Someone from mailing +list.) + +"next" branch will contain all the patches which has been sent on +ltp-mailing list after getting "Acked-By" and/or "Reviewed-By" anyone +from list. This branch is quite unstable but user can find their +immediate patches over here to see the stability.You can find most +unstable about this branch w.r.t feature wise or may be sometime build wise. + + +NOTE: +===== +So i always encourage testcase developer/ltp-list member to send me the +patches against this branch. And it will be closely reviewed and +acknowledged by any member from ltp-list community members. Once it gets +Acked/Reveiwed-By then it will promoted to maint branch for maintainer +testing and checking for stability, otherwise it will go to "pu" branch +for further discussion and decision. These pending patch can be worked +on following month and once it is mature enough to meet the stability +then it can be directly jump to maint branch, here i may ask the +submitter to submit the patch once again against maint branch. + +"pu" branch is basically "proposed update" branch which will contain all +the remainder of above branches. By the above definition of how "next" +works, you can tell that this branch will contain quite experimental and +obviosuly broken stuff. + +I would like to thanks everybody who helped me to release ltp-dev git into +current shape. Especially i would like to thank following: + - git.git from where actually i picked up this branch + identification. + - Garret, who has worked with me step by step to release this git + tree implementation to ltp-list@. + - All my team member from IBM who basically gave encourageable + input and specially Aneesh, Subrata, Iranna & kamalesh. + - And finally to Linux kernel, who motivated me to maintain such a + testsuits with git. + + +Usage: + +#git clone git://ltp.git.sourceforge.net/gitroot/ltp/ltp-dev.git ltp-dev +(Make sure you have the latest autoconf/automake before running make +autotools ) +#make autotools +#./configure +#make +#make install +#cd /opt/ltp +#./runltp + +Please do not hesitate to reply this mail if you have any query in your +mind, it may help me to generate a good FAQ :) . + +Happy Testing!!! + diff --git a/runltp b/runltp index b848a7f..36986af 100755 --- a/runltp +++ b/runltp @@ -846,7 +846,7 @@ main() export TEST_OUTPUT_DIRECTORY="$LTPROOT/output" export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY echo "Generating HTML Output.....!!" - ( perl $LTPROOT/tools/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) + ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) echo "Generated HTML Output.....!!" echo "Location: $HTMLFILE"; diff --git a/testcases/kernel/fs/ftest/ftest01.c b/testcases/kernel/fs/ftest/ftest01.c index c4dc5c8..4fc2fb4 100644 --- a/testcases/kernel/fs/ftest/ftest01.c +++ b/testcases/kernel/fs/ftest/ftest01.c @@ -90,9 +90,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -130,18 +127,8 @@ static void setup(void) * Save starting directory. */ tst_tmpdir(); - getcwd(homedir, sizeof(homedir)); parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "./ftest1.%d", getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_brkm(TBROK,0,"Can't chdir(%s): %s", fuss, strerror(errno)); - } - /* * Default values for run conditions. */ @@ -162,16 +149,16 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; - for(i = 0; i < nchild; i++) { + for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); if (fd < 0) - tst_brkm(TBROK,0, "Can't creating %s/%s: %s", fuss, test_name, strerror(errno)); + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -221,29 +208,6 @@ static void runtest(void) else tst_resm(TFAIL, "Test failed in fork and wait."); - chdir(homedir); - pid = fork(); - - if (pid < 0) { - - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - - tst_resm(TBROK, "Can not remove '%s' due to inability of fork.",fuss); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } - - wait(&status); - - if (status) - tst_resm(TINFO, "CAUTION - ftest1, '%s' may not be removed", fuss); - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest03.c b/testcases/kernel/fs/ftest/ftest03.c index 1cb6d6f..95ad60b 100644 --- a/testcases/kernel/fs/ftest/ftest03.c +++ b/testcases/kernel/fs/ftest/ftest03.c @@ -96,12 +96,9 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; -int main (int ac, char *av[]) +int main(int ac, char *av[]) { int lc; char *msg; @@ -136,33 +133,22 @@ int main (int ac, char *av[]) return 0; } -static void setup(void) +static void cleanup(void) { - char wdbuf[MAXPATHLEN]; + tst_rmdir(); + tst_exit(); +} +static void setup(void) +{ /* * Make a directory to do this in; ignore error if already exists. * Save starting directory. */ tst_tmpdir(); - if (getcwd(homedir, sizeof(homedir)) == NULL) { - tst_resm(TBROK, "getcwd() failed"); - tst_exit(); - } - parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "%s/ftest03.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit() ; - } - /* * Default values for run conditions. */ @@ -181,19 +167,17 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; - for(i = 0; i < nchild; i++) { + for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -241,30 +225,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - - pid = fork(); - - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } else - wait(&status); - - if (status) { - tst_resm(TINFO, "CAUTION - ftest03, '%s' may not be removed", fuss); - tst_resm(TINFO, "CAUTION - ftest03, '%s' may not be removed", - fuss); - } - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest05.c b/testcases/kernel/fs/ftest/ftest05.c index 220d9fd..cf7779a 100644 --- a/testcases/kernel/fs/ftest/ftest05.c +++ b/testcases/kernel/fs/ftest/ftest05.c @@ -94,9 +94,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -135,19 +132,9 @@ static void setup(void) * Save starting directory. */ tst_tmpdir(); - getcwd(homedir, sizeof (homedir)); + parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "./ftest05.%d", getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit(); - } - /* * Default values for run conditions. */ @@ -167,17 +154,15 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -221,28 +206,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - pid = fork(); - - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } - - wait(&status); - - if (status) { - tst_resm(TINFO,"CAUTION - ftest05, '%s' may not be removed", fuss); - } - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest07.c b/testcases/kernel/fs/ftest/ftest07.c index 8cda511..7429874 100644 --- a/testcases/kernel/fs/ftest/ftest07.c +++ b/testcases/kernel/fs/ftest/ftest07.c @@ -86,6 +86,7 @@ int TST_TOTAL = 1; #define MAXIOVCNT 16 static void setup(void); +static void cleanup(void); static void runtest(void); static void dotest(int, int, int); static void domisc(int, int, char*); @@ -102,9 +103,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -141,60 +139,45 @@ int main(int ac, char *av[]) return 0; } -static void setup(void) +static void cleanup(void) { - char wdbuf[MAXPATHLEN], *cwd; + tst_rmdir(); + tst_exit(); +} +static void setup(void) +{ /* * Make a directory to do this in; ignore error if already exists. * Save starting directory. */ - if ((cwd = getcwd(homedir, sizeof (homedir))) == NULL ) { - tst_resm(TBROK,"Failed to get corrent directory") ; - tst_exit(); - } - parent_pid = getpid(); tst_tmpdir(); - if (!fuss[0]) - sprintf(fuss, "%s/ftest07.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit() ; - } - + /* * Default values for run conditions. */ - iterations = 10; nchild = 5; csize = K_2; /* should run with 1, 2, and 4 K sizes */ max_size = K_1 * K_1; misc_intvl = 10; - if (sigset(SIGTERM, term) == SIG_ERR) { - tst_resm(TBROK, " sigset failed: signo = 15") ; - tst_exit() ; - } - + if (sigset(SIGTERM, term) == SIG_ERR) + tst_brkm(TBROK, cleanup, "Sigset failed: signo = 15"); } static void runtest(void) { - int pid, child, status, count, i; + int child, status, count, i; for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -241,25 +224,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - - pid = fork(); - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - exit(1); - } else - wait(&status); - if (status) { - tst_resm(TINFO, "CAUTION - ftest07, '%s' may not be removed", fuss); - } - sync(); } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c index 90c9c99..bff67ed 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c @@ -65,12 +65,8 @@ extern int Tst_count; /* Test Case counter for tst_* routines */ int exp_enos[] = { 0 }; /* List must end with 0 */ -#ifndef CONFIG_COLDFIRE -#define MAXNPROCS 1000000 /* This value is set to an arbitrary high limit. */ -#else -#define MAXNPROCS 100000 /* Coldfire can't deal with 1000000 */ -#endif -#define MAXNREPS 100000 +#define MAXNPROCS 10000 /*These should be sufficient*/ +#define MAXNREPS 10000 /*Else they srewup the system un-necessarily*/ #define FAIL 1 #define PASS 0 diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c index 63b9367..dbda820 100644 --- a/testcases/kernel/syscalls/linkat/linkat01.c +++ b/testcases/kernel/syscalls/linkat/linkat01.c @@ -158,7 +158,7 @@ struct test_struct { { &cwd_fd, "/proc/cpuinfo", &newdirfd, TEST_FILE1, 0, 0, 0, EXDEV }, /* 21. directory link */ - { &cwd_fd, "/tmp", &newdirfd, TEST_FILE1, 0, + { &olddirfd, ".", &newdirfd, TEST_FILE1, 0, 0, 0, EPERM }, /* 22. invalid flag */ { &olddirfd, TEST_FILE1, &newdirfd, TEST_FILE1, 1, diff --git a/testcases/realtime/func/prio-wake/prio-wake.c b/testcases/realtime/func/prio-wake/prio-wake.c index 74007f6..1703451 100644 --- a/testcases/realtime/func/prio-wake/prio-wake.c +++ b/testcases/realtime/func/prio-wake/prio-wake.c @@ -108,7 +108,11 @@ void *master_thread(void* arg) /* make sure children are started */ while (running_threads < rt_threads) - sleep(1); + usleep(1000); + /* give the worker threads a chance to get to sleep in the kernel + * in the unlocked broadcast case. */ + usleep(1000); + start = rt_gettime() - beginrun; @@ -120,8 +124,6 @@ void *master_thread(void* arg) if (locked_broadcast) rc = pthread_mutex_unlock(&mutex); - while (running_threads > 0) - sleep(1); return NULL; } @@ -157,9 +159,6 @@ void *worker_thread(void* arg) rc = pthread_mutex_unlock(&mutex); - /* wait for all threads to quit */ - while (running_threads > 0) - sleep(1); return NULL; } diff --git a/testscripts/test_fs_bind.sh b/testscripts/test_fs_bind.sh index 39a237e..9ab533a 100755 --- a/testscripts/test_fs_bind.sh +++ b/testscripts/test_fs_bind.sh @@ -238,7 +238,7 @@ restore_proc_mounts() # new mounts around and will never remove mounts outside the test # directory ( while grep_proc_mounts ; do - grep_proc_mounts | awk '{print $2}' | xargs -r --max-args=1 umount -l + grep_proc_mounts | awk '{print $2}' | xargs -r -n 1 umount -l done ) >& /dev/null # mount list and exit with 0 hooks/post-receive -- ltp |