* [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test @ 2014-06-30 8:18 Zeng Linggang 2014-06-30 8:38 ` Jan Stancek 2014-08-06 10:19 ` Zeng Linggang 0 siblings, 2 replies; 5+ messages in thread From: Zeng Linggang @ 2014-06-30 8:18 UTC (permalink / raw) To: ltp-list * Add new ECHILD errno test for waitid(2) idtype and id (waitid()) is not a child of the calling process. * Cleanup: remove an useless tst_exit() * Add tst_count = 0 Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com> --- testcases/kernel/syscalls/waitid/waitid02.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/syscalls/waitid/waitid02.c b/testcases/kernel/syscalls/waitid/waitid02.c index 3806655..6259fa3 100644 --- a/testcases/kernel/syscalls/waitid/waitid02.c +++ b/testcases/kernel/syscalls/waitid/waitid02.c @@ -130,6 +130,16 @@ struct testcase_t tdat[] = { .setup = setup6, .cleanup = cleanup6 }, + { + .msg = "P_PID, WEXITED not a child of the calling process", + .idtype = P_PID, + .id = 1, + .options = WEXITED, + .exp_ret = -1, + .exp_errno = ECHILD, + .setup = setup2, + .cleanup = cleanup2 + }, }; @@ -281,13 +291,12 @@ int main(int ac, char **av) const char *msg; msg = parse_opts(ac, av, NULL, NULL); - if (msg != NULL) { + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } setup(); for (lc = 0; TEST_LOOPING(lc); ++lc) { + tst_count = 0; for (testno = 0; testno < TST_TOTAL; testno++) test_waitid(&tdat[testno]); } -- 1.9.3 ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test 2014-06-30 8:18 [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test Zeng Linggang @ 2014-06-30 8:38 ` Jan Stancek 2014-06-30 9:30 ` Zeng Linggang 2014-08-06 10:19 ` Zeng Linggang 1 sibling, 1 reply; 5+ messages in thread From: Jan Stancek @ 2014-06-30 8:38 UTC (permalink / raw) To: Zeng Linggang; +Cc: ltp-list ----- Original Message ----- > From: "Zeng Linggang" <zenglg.jy@cn.fujitsu.com> > To: "ltp-list" <ltp-list@lists.sourceforge.net> > Sent: Monday, 30 June, 2014 10:18:17 AM > Subject: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test > > * Add new ECHILD errno test for waitid(2) > idtype and id (waitid()) is not a child of the calling process. > > * Cleanup: remove an useless tst_exit() > > * Add tst_count = 0 > > Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com> Hi, looks good to me. I'm assuming the reason for setup/cleanup is that you wanted some unrelated child to be present. Regards, Jan > --- > testcases/kernel/syscalls/waitid/waitid02.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/testcases/kernel/syscalls/waitid/waitid02.c > b/testcases/kernel/syscalls/waitid/waitid02.c > index 3806655..6259fa3 100644 > --- a/testcases/kernel/syscalls/waitid/waitid02.c > +++ b/testcases/kernel/syscalls/waitid/waitid02.c > @@ -130,6 +130,16 @@ struct testcase_t tdat[] = { > .setup = setup6, > .cleanup = cleanup6 > }, > + { > + .msg = "P_PID, WEXITED not a child of the calling process", > + .idtype = P_PID, > + .id = 1, > + .options = WEXITED, > + .exp_ret = -1, > + .exp_errno = ECHILD, > + .setup = setup2, > + .cleanup = cleanup2 > + }, > > }; > > @@ -281,13 +291,12 @@ int main(int ac, char **av) > const char *msg; > > msg = parse_opts(ac, av, NULL, NULL); > - if (msg != NULL) { > + if (msg != NULL) > tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); > - tst_exit(); > - } > > setup(); > for (lc = 0; TEST_LOOPING(lc); ++lc) { > + tst_count = 0; > for (testno = 0; testno < TST_TOTAL; testno++) > test_waitid(&tdat[testno]); > } > -- > 1.9.3 > > > > > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > Ltp-list mailing list > Ltp-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ltp-list > ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test 2014-06-30 8:38 ` Jan Stancek @ 2014-06-30 9:30 ` Zeng Linggang 2014-08-06 11:20 ` chrubis 0 siblings, 1 reply; 5+ messages in thread From: Zeng Linggang @ 2014-06-30 9:30 UTC (permalink / raw) To: Jan Stancek; +Cc: ltp-list On Mon, 2014-06-30 at 04:38 -0400, Jan Stancek wrote: > > ----- Original Message ----- > > From: "Zeng Linggang" <zenglg.jy@cn.fujitsu.com> > > To: "ltp-list" <ltp-list@lists.sourceforge.net> > > Sent: Monday, 30 June, 2014 10:18:17 AM > > Subject: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test > > > > * Add new ECHILD errno test for waitid(2) > > idtype and id (waitid()) is not a child of the calling process. > > > > * Cleanup: remove an useless tst_exit() > > > > * Add tst_count = 0 > > > > Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com> > > Hi, > > looks good to me. I'm assuming the reason for setup/cleanup > is that you wanted some unrelated child to be present. > Hi, Thank you for your review and test. :) As you can see, there has been a test for ECHILD in waitid02.c. That test for idtype and id (waitid()) does not exist. In this patch, the process calls fork to get a child, but it waits for the other process, then ECHILD would return. After the test, calling cleanup. That test for idtype and id (waitid()) is not a child of the calling process. Best regards, Zeng > Regards, > Jan > > > --- > > testcases/kernel/syscalls/waitid/waitid02.c | 15 ++++++++++++--- > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > diff --git a/testcases/kernel/syscalls/waitid/waitid02.c > > b/testcases/kernel/syscalls/waitid/waitid02.c > > index 3806655..6259fa3 100644 > > --- a/testcases/kernel/syscalls/waitid/waitid02.c > > +++ b/testcases/kernel/syscalls/waitid/waitid02.c > > @@ -130,6 +130,16 @@ struct testcase_t tdat[] = { > > .setup = setup6, > > .cleanup = cleanup6 > > }, > > + { > > + .msg = "P_PID, WEXITED not a child of the calling process", > > + .idtype = P_PID, > > + .id = 1, > > + .options = WEXITED, > > + .exp_ret = -1, > > + .exp_errno = ECHILD, > > + .setup = setup2, > > + .cleanup = cleanup2 > > + }, > > > > }; > > > > @@ -281,13 +291,12 @@ int main(int ac, char **av) > > const char *msg; > > > > msg = parse_opts(ac, av, NULL, NULL); > > - if (msg != NULL) { > > + if (msg != NULL) > > tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); > > - tst_exit(); > > - } > > > > setup(); > > for (lc = 0; TEST_LOOPING(lc); ++lc) { > > + tst_count = 0; > > for (testno = 0; testno < TST_TOTAL; testno++) > > test_waitid(&tdat[testno]); > > } > > -- > > 1.9.3 > > > > > > > > > > ------------------------------------------------------------------------------ > > Open source business process management suite built on Java and Eclipse > > Turn processes into business applications with Bonita BPM Community Edition > > Quickly connect people, data, and systems into organized workflows > > Winner of BOSSIE, CODIE, OW2 and Gartner awards > > http://p.sf.net/sfu/Bonitasoft > > _______________________________________________ > > Ltp-list mailing list > > Ltp-list@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/ltp-list > > ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test 2014-06-30 9:30 ` Zeng Linggang @ 2014-08-06 11:20 ` chrubis 0 siblings, 0 replies; 5+ messages in thread From: chrubis @ 2014-08-06 11:20 UTC (permalink / raw) To: Zeng Linggang; +Cc: ltp-list Hi! > > Hi, > > > > looks good to me. I'm assuming the reason for setup/cleanup > > is that you wanted some unrelated child to be present. > > > > Hi, > Thank you for your review and test. :) > As you can see, there has been a test for ECHILD in waitid02.c. That > test for idtype and id (waitid()) does not exist. > In this patch, the process calls fork to get a child, but it waits for > the other process, then ECHILD would return. After the test, calling > cleanup. That test for idtype and id (waitid()) is not a child of the > calling process. I've modified the commit message to explain why we keep child waiting in the background and pushed, thanks. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test 2014-06-30 8:18 [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test Zeng Linggang 2014-06-30 8:38 ` Jan Stancek @ 2014-08-06 10:19 ` Zeng Linggang 1 sibling, 0 replies; 5+ messages in thread From: Zeng Linggang @ 2014-08-06 10:19 UTC (permalink / raw) To: ltp-list Ping. :) Best regards, Zeng On Mon, 2014-06-30 at 16:18 +0800, Zeng Linggang wrote: > * Add new ECHILD errno test for waitid(2) > idtype and id (waitid()) is not a child of the calling process. > > * Cleanup: remove an useless tst_exit() > > * Add tst_count = 0 > > Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com> > --- > testcases/kernel/syscalls/waitid/waitid02.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/testcases/kernel/syscalls/waitid/waitid02.c b/testcases/kernel/syscalls/waitid/waitid02.c > index 3806655..6259fa3 100644 > --- a/testcases/kernel/syscalls/waitid/waitid02.c > +++ b/testcases/kernel/syscalls/waitid/waitid02.c > @@ -130,6 +130,16 @@ struct testcase_t tdat[] = { > .setup = setup6, > .cleanup = cleanup6 > }, > + { > + .msg = "P_PID, WEXITED not a child of the calling process", > + .idtype = P_PID, > + .id = 1, > + .options = WEXITED, > + .exp_ret = -1, > + .exp_errno = ECHILD, > + .setup = setup2, > + .cleanup = cleanup2 > + }, > > }; > > @@ -281,13 +291,12 @@ int main(int ac, char **av) > const char *msg; > > msg = parse_opts(ac, av, NULL, NULL); > - if (msg != NULL) { > + if (msg != NULL) > tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); > - tst_exit(); > - } > > setup(); > for (lc = 0; TEST_LOOPING(lc); ++lc) { > + tst_count = 0; > for (testno = 0; testno < TST_TOTAL; testno++) > test_waitid(&tdat[testno]); > } ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-06 11:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-30 8:18 [LTP] [PATCH] waitid/waitid02.c: Add new ECHILD errno test Zeng Linggang 2014-06-30 8:38 ` Jan Stancek 2014-06-30 9:30 ` Zeng Linggang 2014-08-06 11:20 ` chrubis 2014-08-06 10:19 ` Zeng Linggang
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.