From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Monson Shao <jshao@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/3] pidns16: split test condition and result judge
Date: Wed, 26 Dec 2012 14:11:40 +0800 [thread overview]
Message-ID: <50DA951C.7030106@cn.fujitsu.com> (raw)
In-Reply-To: <1356420393-4253-1-git-send-email-jshao@redhat.com>
On 12/25/2012 03:26 PM, Monson Shao wrote:
> Make it easy to read.
>
> Signed-off-by: Monson Shao <jshao@redhat.com>
> ---
> testcases/kernel/containers/pidns/pidns16.c | 24 ++++++++++++++++--------
> 1 个文件被修改,插入 16 行(+),删除 8 行(-)
>
> diff --git a/testcases/kernel/containers/pidns/pidns16.c b/testcases/kernel/containers/pidns/pidns16.c
> index 8a232c6..9a1219a 100644
> --- a/testcases/kernel/containers/pidns/pidns16.c
> +++ b/testcases/kernel/containers/pidns/pidns16.c
> @@ -70,17 +70,25 @@ void cleanup()
> void child_signal_handler(int sig, siginfo_t * si, void *unused)
> {
> static int c = 1;
> + pid_t expected_pid;
> +
> /* Verifying from which process the signal handler is signalled */
>
> - if ((c == 1) && (si->si_pid == globalpid))
> - tst_resm(TINFO, "sig_handler is signalled from pid %d",
> - globalpid);
> - else if ((c == 2) && (si->si_pid == CHILD_PID))
> - tst_resm(TINFO, "sig_handler is signalled from pid %d",
> - CHILD_PID);
> + if (c == 1)
> + expected_pid = globalpid;
> + else if (c == 2)
> + expected_pid = CHILD_PID;
> + else {
> + tst_resm(TBROK, "child should NOT be signalled 3+ times");
> + return;
> + }
Please add braces in both branches here.
Thanks,
Wanlong Gao
> +
> + if (si->si_pid == expected_pid)
> + tst_resm(TINFO, "child is signalled from pid %d", expected_pid);
> else
> - tst_resm(TBROK, "Unexpected value for Sending-ProcessID"
> - " when signal handler called %d\n", si->si_pid);
> + tst_resm(TBROK, "child is signalled from unexpected pid %d,"
> + " expecting pid %d", si->si_pid, expected_pid);
> +
> c++;
> }
>
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-12-26 6:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-25 7:26 [LTP] [PATCH 1/3] pidns16: split test condition and result judge Monson Shao
2012-12-26 6:11 ` Wanlong Gao [this message]
2012-12-26 8:48 ` [LTP] [PATCHv2 " Monson Shao
2013-01-03 3:12 ` Wanlong Gao
2013-01-03 3:14 ` Wanlong Gao
2012-12-26 8:48 ` [LTP] [PATCHv2 2/3] pidns16: modified test results Monson Shao
2013-01-03 3:12 ` Wanlong Gao
2012-12-26 8:48 ` [LTP] [PATCHv2 3/3] pidns16: child should not get parent pid in parent NS Monson Shao
2013-01-03 3:12 ` Wanlong Gao
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=50DA951C.7030106@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=jshao@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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