public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2 1/2] lib/tst_res.c: introduce tst_record_childstatus()
Date: Tue, 22 Jul 2014 16:30:00 +0200	[thread overview]
Message-ID: <20140722143000.GA22955@rei> (raw)
In-Reply-To: <53CCA4B9.2070005@cn.fujitsu.com>

Hi!
> >> In case we need do real test work in child porcess, it is OK for child process
> >> to use tst_resm(), tst_brkm() or tst_exit(). Parent process can use
> >> tst_record_childstatus() to make child process's test results propagated to parent
> >> process correctly.
> >>
> >> Meanwhile we reset T_exitval to 0 for child process in tst_fork(), which will
> >> make child process can record test results with tst_resm() or tst_brkm() correctly.
> > 
> > Looks technically correct to me. The only caveat is that you have to
> > decide to use either tst_* interface in child or plain exit() and do not
> > to mix them.
> Yeah, Or I should write some notes about using tst_* interfaces in child process in Test Writing Guidelines.
> And sorry for the delay, I was busy last week.

Yes, this patch would need more changes into the Test Writing Guidelines
anyway...

> > Also as the code si now we don't have to reset the T_exitval because
> > what we do now is or the flags form child to add them to the paren't
> > flags (which will be set anyway if the child has started with nonzero
> > flags).
> 
> Ah, you are right.
> But I think reseting T_exitval is necessary, at least we should give child process
> a clean test environment...
> Assume a simple case:
>   Parent already has TFAIL set, then it fork() a child to have some
> other test work and everything is OK in child, child only calls tst_resm(TPASS,...),
> then in child, T_exitval will have TPASS and TFAIL set. Finally, child calls
> tst_exit() to report the test results, in this case, child will return a 
> non-zero value, it seems child exits abnormally, though it does not affect the final
> test results, it is still not reasonable, obviously 0 value is reasonable for child, 
> after all child does not do any wrong.

Yes, it's better to reset it but it's not really necessary.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-07-22 14:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13  5:49 [LTP] [PATCH v2 1/2] lib/tst_res.c: introduce tst_record_childstatus() Xiaoguang Wang
2014-07-13  5:49 ` [LTP] [PATCH v2 2/2] syscalls: fix testcases which take TCONF as TFAIL Xiaoguang Wang
2014-07-15 14:24 ` [LTP] [PATCH v2 1/2] lib/tst_res.c: introduce tst_record_childstatus() chrubis
     [not found]   ` <53CCA4B9.2070005@cn.fujitsu.com>
2014-07-22 14:30     ` chrubis [this message]
2014-07-28 11:51       ` [LTP] [PATCH v3 1/3] " Xiaoguang Wang
2014-07-28 11:51         ` [LTP] [PATCH v3 2/3] doc: add paragraph to describe using test interface in child process Xiaoguang Wang
2014-07-29  9:58           ` chrubis
2014-07-28 11:51         ` [LTP] [PATCH v3 3/3] syscalls: fix testcases which take TCONF as TFAIL Xiaoguang Wang
2014-07-29 10:09           ` chrubis
2014-07-29  9:56         ` [LTP] [PATCH v3 1/3] lib/tst_res.c: introduce tst_record_childstatus() chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140722143000.GA22955@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox