All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] clone09: add a test for CLONE_NEWNET flag
Date: Thu, 22 Jun 2017 17:09:32 +0200	[thread overview]
Message-ID: <20170622150932.GC28231@rei.lan> (raw)
In-Reply-To: <1496915851-5222-2-git-send-email-alexey.kodanev@oracle.com>

Hi!
> +static void do_test(void)
> +{
> +	int def_val;
> +
> +	tst_res(TINFO, "create clone in a new netns with 'CLONE_NEWNET' flag");
> +
> +	SAFE_FILE_SCANF(sysctl_path, "%d", &sysctl_net);
> +	SAFE_FILE_PRINTF(sysctl_path, "%d", sysctl_net + 1);
> +
> +	clone_child();
> +	tst_reap_children();
> +
> +	if (sysctl_net_new == (sysctl_net + 1)) {
> +		tst_res(TFAIL, "sysctl params equal: %s=%d",
> +			sysctl_path, sysctl_net_new);
> +	}
> +
> +	SAFE_FILE_SCANF(sysctl_path_def, "%d", &def_val);
> +
> +	if (sysctl_net_new != def_val) {
> +		tst_res(TFAIL, "netns param init to non-default value %d",
> +			sysctl_net_new);
> +	}

We should restore the sysctl_path value here, in a case that we are
looping (the -i or -I options).

Otherwise it looks fine.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-06-22 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08  9:57 [LTP] [PATCH v2 1/2] clone08: convert to new LTP API Alexey Kodanev
2017-06-08  9:57 ` [LTP] [PATCH v2 2/2] clone09: add a test for CLONE_NEWNET flag Alexey Kodanev
2017-06-22 15:09   ` Cyril Hrubis [this message]
2017-07-18 12:02     ` Alexey Kodanev
2017-06-22 15:01 ` [LTP] [PATCH v2 1/2] clone08: convert to new LTP API Cyril Hrubis
2017-07-18 12:00   ` Alexey Kodanev
  -- strict thread matches above, loose matches on Subject: below --
2017-04-14 10:15 [LTP] [PATCH 1/3] tst_safe_sysv_ipc: add shared memory related macros Xiao Yang
2017-04-14 10:15 ` [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test Xiao Yang
2017-05-29 14:57   ` Cyril Hrubis
2017-06-01 11:53     ` Xiao Yang
2017-06-22 10:09       ` Xiao Yang
2017-06-22 11:08         ` Xiao Yang
2017-06-22 12:02           ` Jan Stancek
2017-06-22 15:11             ` [LTP] [PATCH v2 2/2] clone09: add a test for CLONE_NEWNET flag Cyril Hrubis
2017-06-23  7:22               ` Richard Palethorpe

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=20170622150932.GC28231@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 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.