From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] add test for tst_checkpoint_signal_child timing out
Date: Thu, 14 Nov 2013 15:32:28 +0100 [thread overview]
Message-ID: <20131114143228.GB14170@rei> (raw)
In-Reply-To: <1a7334c8ecd0ea0adb174c7c55667844d971a3f2.1384419525.git.jstancek@redhat.com>
Hi!
> This is simple test for patch which adds timeout to
> tst_checkpoint_signal_child().
>
> The test is expected to end with:
> Failed to open fifo 'tst_checkpoint_fifo' at
> tst_checkpoint_child_exits2.c:56: errno=ETIMEDOUT(110): Connection timed out
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> .gitignore | 1 +
> lib/tests/tst_checkpoint_child_exits2.c | 62 +++++++++++++++++++++++++++++++
> 2 files changed, 63 insertions(+), 0 deletions(-)
> create mode 100644 lib/tests/tst_checkpoint_child_exits2.c
>
> diff --git a/.gitignore b/.gitignore
> index 140f5f4..dfee1ad 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -55,6 +55,7 @@ logfile.*
> /lib/tests/tst_tmpdir_test
> /lib/tests/tst_checkpoint_child
> /lib/tests/tst_checkpoint_child_exits
> +/lib/tests/tst_checkpoint_child_exits2
> /lib/tests/tst_checkpoint_parent
> /lib/tests/tst_checkpoint_parent_exits
> /lib/tests/tst_process_state
> diff --git a/lib/tests/tst_checkpoint_child_exits2.c b/lib/tests/tst_checkpoint_child_exits2.c
> new file mode 100644
> index 0000000..fb79145
> --- /dev/null
> +++ b/lib/tests/tst_checkpoint_child_exits2.c
> @@ -0,0 +1,62 @@
> +/*
> + * Copyright (C) 2013 Linux Test Project
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of version 2 of the GNU General Public License as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it would be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + * Further, this software is distributed without any warranty that it is
> + * free of the rightful claim of any third person regarding infringement
> + * or the like. Any license provided herein, whether implied or
> + * otherwise, applies only to this software file. Patent licenses, if
> + * any, provided herein do not apply to combinations of this program with
> + * other software, or any other product whatsoever.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +
> +#include <sys/wait.h>
> +
> +#include "test.h"
> +
> +char *TCID = "tst_checkpoint_child_exits2";
> +int TST_TOTAL = 1;
> +
> +static void cleanup(void)
> +{
> + tst_rmdir();
> +}
> +
> +int main(void)
> +{
> + int pid;
> + struct tst_checkpoint checkpoint;
> +
> + tst_tmpdir();
> +
> + pid = fork();
> +
> + switch (pid) {
> + case -1:
> + tst_brkm(TBROK | TERRNO, NULL, "Fork failed");
> + break;
> + case 0:
> + fprintf(stderr, "Child: exiting prior checkpoint init\n");
> + exit(0);
> + break;
We don't even have the do the for here simply calling just the
checkpoint init and checkpoint signal would do. :)
If you agree I can commit the simplified version right away.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-11-14 14:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 9:05 [LTP] [PATCH] add test for tst_checkpoint_signal_child timing out Jan Stancek
2013-11-14 14:32 ` chrubis [this message]
2013-11-14 14:34 ` 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=20131114143228.GB14170@rei \
--to=chrubis@suse.cz \
--cc=jstancek@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