All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] lib/tst_net.sh: don't init ltp_ns if custom is used
Date: Thu, 12 Apr 2018 19:09:11 +0300	[thread overview]
Message-ID: <1523549352-1794-1-git-send-email-alexey.kodanev@oracle.com> (raw)

We can define our own LTP_NETNS with custom setup, don't setup
the default one in that particular case.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/lib/tst_net.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index bbef12a..53f6277 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -103,7 +103,7 @@ init_ltp_netspace()
 
 	local pid=
 
-	if [ ! -f /var/run/netns/ltp_ns ]; then
+	if [ ! -f /var/run/netns/ltp_ns -a -z "$LTP_NETNS" ]; then
 		ROD ip li add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
 		pid="$(ROD ns_create net,mnt)"
 		mkdir -p /var/run/netns
@@ -112,6 +112,8 @@ init_ltp_netspace()
 		ROD ns_exec $pid net,mnt mount -t sysfs none /sys
 		ROD ns_ifmove ltp_ns_veth1 $pid
 		ROD ns_exec $pid net,mnt ip li set lo up
+	else
+		tst_res_ TINFO "using not default LTP netns: '$LTP_NETNS'"
 	fi
 
 	LHOST_IFACES="${LHOST_IFACES:-ltp_ns_veth2}"
-- 
1.7.1


             reply	other threads:[~2018-04-12 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 16:09 Alexey Kodanev [this message]
2018-04-12 16:09 ` [LTP] [PATCH 2/2] lib/tst_net.sh: use nodad in tst_add_ipaddr() Alexey Kodanev
2018-04-12 16:45 ` [LTP] [PATCH 1/2] lib/tst_net.sh: don't init ltp_ns if custom is used Alexey Kodanev
2018-04-19 13:32   ` Alexey Kodanev

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=1523549352-1794-1-git-send-email-alexey.kodanev@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --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.