All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 0/2] Run tests forcely in separated netns
@ 2015-05-12 14:40 Vadim Kochan
  2015-05-12 14:40 ` [PATCH iproute2 1/2] tests: Run each test in network namespace Vadim Kochan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vadim Kochan @ 2015-05-12 14:40 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

Changed to run each test in separated network namespace by using
'unshare' tool from util-linux tools set, it allows to do not affect
network setup on the host machine, 'unshare' tool is required by default.

Also added test which checks already fixed BUG related to adding default route.

Vadim Kochan (2):
  tests: Run each test in network namespace
  tests: Add test for 'ip route add default'

 testsuite/Makefile                           |  7 ++++++-
 testsuite/tests/ip/route/add_default_route.t | 12 ++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100755 testsuite/tests/ip/route/add_default_route.t

-- 
2.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH iproute2 1/2] tests: Run each test in network namespace
  2015-05-12 14:40 [PATCH iproute2 0/2] Run tests forcely in separated netns Vadim Kochan
@ 2015-05-12 14:40 ` Vadim Kochan
  2015-05-12 14:40 ` [PATCH iproute2 2/2] tests: Add test for 'ip route add default' Vadim Kochan
  2015-05-21 21:46 ` [PATCH iproute2 0/2] Run tests forcely in separated netns Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Vadim Kochan @ 2015-05-12 14:40 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

Changed to forcely running each test in network
namespace to do not affect on current network setup.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 testsuite/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testsuite/Makefile b/testsuite/Makefile
index a2c8a2d..4b945b0 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -1,9 +1,11 @@
 ## -- Config --
 DEV := lo
-PREFIX := sudo -E
+PREFIX := sudo -E unshare -n
 RESULTS_DIR := results
 ## -- End Config --
 
+HAVE_UNSHARED_UTIL := $(shell unshare --version 2> /dev/null)
+
 rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
 
 TESTS := $(patsubst tests/%,%,$(call rwildcard,tests/,*.t))
@@ -38,6 +40,9 @@ distclean: clean
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
 
 $(TESTS): clean
+ifeq (,$(HAVE_UNSHARED_UTIL))
+	$(error Please install util-linux tools to run tests in separated network namespace)
+endif
 	@mkdir -p $(RESULTS_DIR)
 	
 	@for d in $(TESTS_DIR); do \
-- 
2.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH iproute2 2/2] tests: Add test for 'ip route add default'
  2015-05-12 14:40 [PATCH iproute2 0/2] Run tests forcely in separated netns Vadim Kochan
  2015-05-12 14:40 ` [PATCH iproute2 1/2] tests: Run each test in network namespace Vadim Kochan
@ 2015-05-12 14:40 ` Vadim Kochan
  2015-05-21 21:46 ` [PATCH iproute2 0/2] Run tests forcely in separated netns Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Vadim Kochan @ 2015-05-12 14:40 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 testsuite/tests/ip/route/add_default_route.t | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100755 testsuite/tests/ip/route/add_default_route.t

diff --git a/testsuite/tests/ip/route/add_default_route.t b/testsuite/tests/ip/route/add_default_route.t
new file mode 100755
index 0000000..2908528
--- /dev/null
+++ b/testsuite/tests/ip/route/add_default_route.t
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+source lib/generic.sh
+
+ts_log "[Testing add default route]"
+
+DEV=dummy0
+
+ts_ip "$0" "Add new interface $DEV" link add $DEV type dummy
+ts_ip "$0" "Set $DEV into UP state" link set up dev $DEV
+ts_ip "$0" "Add 1.1.1.1/24 addr on $DEV" addr add 1.1.1.1/24 dev $DEV
+ts_ip "$0" "Add default route via 1.1.1.1" route add default via 1.1.1.1
-- 
2.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2 0/2] Run tests forcely in separated netns
  2015-05-12 14:40 [PATCH iproute2 0/2] Run tests forcely in separated netns Vadim Kochan
  2015-05-12 14:40 ` [PATCH iproute2 1/2] tests: Run each test in network namespace Vadim Kochan
  2015-05-12 14:40 ` [PATCH iproute2 2/2] tests: Add test for 'ip route add default' Vadim Kochan
@ 2015-05-21 21:46 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2015-05-21 21:46 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev

On Tue, 12 May 2015 17:40:14 +0300
Vadim Kochan <vadim4j@gmail.com> wrote:

> From: Vadim Kochan <vadim4j@gmail.com>
> 
> Changed to run each test in separated network namespace by using
> 'unshare' tool from util-linux tools set, it allows to do not affect
> network setup on the host machine, 'unshare' tool is required by default.
> 
> Also added test which checks already fixed BUG related to adding default route.
> 
> Vadim Kochan (2):
>   tests: Run each test in network namespace
>   tests: Add test for 'ip route add default'
> 
>  testsuite/Makefile                           |  7 ++++++-
>  testsuite/tests/ip/route/add_default_route.t | 12 ++++++++++++
>  2 files changed, 18 insertions(+), 1 deletion(-)
>  create mode 100755 testsuite/tests/ip/route/add_default_route.t
> 

Applied thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-21 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 14:40 [PATCH iproute2 0/2] Run tests forcely in separated netns Vadim Kochan
2015-05-12 14:40 ` [PATCH iproute2 1/2] tests: Run each test in network namespace Vadim Kochan
2015-05-12 14:40 ` [PATCH iproute2 2/2] tests: Add test for 'ip route add default' Vadim Kochan
2015-05-21 21:46 ` [PATCH iproute2 0/2] Run tests forcely in separated netns Stephen Hemminger

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.