All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
@ 2016-12-21 23:04 Petr Vorel
  2016-12-21 23:04 ` [LTP] [PATCH 2/3] test_net.sh: delete netns before testing Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Petr Vorel @ 2016-12-21 23:04 UTC (permalink / raw)
  To: ltp

Tested with:
TST_USE_NETNS=1 LHOST_IFACES=localpeer RHOST_IFACES=remotepeer \
  ./testscripts/network.sh -6

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/test_net.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index f5321d73a..7d82e8962 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -22,15 +22,15 @@
 
 init_ltp_netspace()
 {
+	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
+	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
+
 	if [ ! -f /var/run/netns/ltp_ns ]; then
 		ROD ip net add ltp_ns
-		ROD ip li add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
-		ROD ip li set dev ltp_ns_veth1 netns ltp_ns
+		ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
+		ROD ip li set dev $RHOST_IFACES netns ltp_ns
 	fi
 
-	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
-	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
-
 	export TST_INIT_NETNS="no"
 	export LTP_NETNS=${LTP_NETNS:-"ip netns exec ltp_ns"}
 
-- 
2.11.0


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

* [LTP] [PATCH 2/3] test_net.sh: delete netns before testing
  2016-12-21 23:04 [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Petr Vorel
@ 2016-12-21 23:04 ` Petr Vorel
  2016-12-22 11:08   ` Alexey Kodanev
  2016-12-21 23:04 ` [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run Petr Vorel
  2016-12-22 10:47 ` [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Alexey Kodanev
  2 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2016-12-21 23:04 UTC (permalink / raw)
  To: ltp

Tested with (second run breaks it):
TST_USE_NETNS=1 ./testscripts/network.sh -6

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
It shouldn't be a problem as 'export TST_INIT_NETNS="no"' help us not to
redefine each time test_net.sh is loaded.
---
 testcases/lib/test_net.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 7d82e8962..535a2abb3 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -25,11 +25,10 @@ init_ltp_netspace()
 	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
 	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
 
-	if [ ! -f /var/run/netns/ltp_ns ]; then
-		ROD ip net add ltp_ns
-		ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
-		ROD ip li set dev $RHOST_IFACES netns ltp_ns
-	fi
+	ip netns del ltp_ns 2>/dev/null
+	ROD ip net add ltp_ns
+	ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
+	ROD ip li set dev $RHOST_IFACES netns ltp_ns
 
 	export TST_INIT_NETNS="no"
 	export LTP_NETNS=${LTP_NETNS:-"ip netns exec ltp_ns"}
-- 
2.11.0


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

* [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run
  2016-12-21 23:04 [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Petr Vorel
  2016-12-21 23:04 ` [LTP] [PATCH 2/3] test_net.sh: delete netns before testing Petr Vorel
@ 2016-12-21 23:04 ` Petr Vorel
  2017-01-19 17:50   ` Petr Vorel
  2016-12-22 10:47 ` [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Alexey Kodanev
  2 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2016-12-21 23:04 UTC (permalink / raw)
  To: ltp

netns can be set by test_net.sh when RHOST is unset, but user wants to
use ssh, so it should be first tested.

Tested with:
TST_USE_SSH=1 ./testscripts/network.sh -6

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Even it's configuration error, we should handle it as before netns was user
warned about config error.
---
 testcases/lib/test_net.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 535a2abb3..8fc14c588 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -88,12 +88,12 @@ tst_rhost_run()
 
 	local output=
 	local ret=0
-	if [ -n "$TST_USE_SSH" ]; then
-		output=`ssh -n -q $user@$RHOST "sh -c \
-			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
-	elif [ -n "$TST_USE_NETNS" ]; then
+	if [ -n "$TST_USE_NETNS" ]; then
 		output=`$LTP_NETNS sh -c \
 			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
+	elif [ -n "$TST_USE_SSH" ]; then
+		output=`ssh -n -q $user@$RHOST "sh -c \
+			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
 	else
 		output=`rsh -n -l $user $RHOST "sh -c \
 			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
-- 
2.11.0


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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-21 23:04 [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Petr Vorel
  2016-12-21 23:04 ` [LTP] [PATCH 2/3] test_net.sh: delete netns before testing Petr Vorel
  2016-12-21 23:04 ` [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run Petr Vorel
@ 2016-12-22 10:47 ` Alexey Kodanev
  2016-12-22 13:01   ` Petr Vorel
  2 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2016-12-22 10:47 UTC (permalink / raw)
  To: ltp

Hi,

On 12/22/2016 02:04 AM, Petr Vorel wrote:
> Tested with:
> TST_USE_NETNS=1 LHOST_IFACES=localpeer RHOST_IFACES=remotepeer \
>    ./testscripts/network.sh -6

Any good reason to do that?

Thanks,
Alexey

>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>   testcases/lib/test_net.sh | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
> index f5321d73a..7d82e8962 100644
> --- a/testcases/lib/test_net.sh
> +++ b/testcases/lib/test_net.sh
> @@ -22,15 +22,15 @@
>   
>   init_ltp_netspace()
>   {
> +	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
> +	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
> +
>   	if [ ! -f /var/run/netns/ltp_ns ]; then
>   		ROD ip net add ltp_ns
> -		ROD ip li add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
> -		ROD ip li set dev ltp_ns_veth1 netns ltp_ns
> +		ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
> +		ROD ip li set dev $RHOST_IFACES netns ltp_ns
>   	fi
>   
> -	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
> -	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
> -
>   	export TST_INIT_NETNS="no"
>   	export LTP_NETNS=${LTP_NETNS:-"ip netns exec ltp_ns"}
>   


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

* [LTP] [PATCH 2/3] test_net.sh: delete netns before testing
  2016-12-21 23:04 ` [LTP] [PATCH 2/3] test_net.sh: delete netns before testing Petr Vorel
@ 2016-12-22 11:08   ` Alexey Kodanev
  2016-12-23 11:04     ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2016-12-22 11:08 UTC (permalink / raw)
  To: ltp

On 12/22/2016 02:04 AM, Petr Vorel wrote:
> Tested with (second run breaks it):
> TST_USE_NETNS=1 ./testscripts/network.sh -6

Hmm, could you describe the error you are getting?
I cannot reproduce it in my environment.

...or is it about setting IPv6 address for the second time on the interface,
because network.sh and test_net.sh are both using the same '-6' option?

network_settings 1 TINFO : set local addr fd00:1:1:1::2/64
RTNETLINK answers: File exists

Moreover, it's not needed to set TST_USE_NETNS.

Thanks,
Alexey

>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> It shouldn't be a problem as 'export TST_INIT_NETNS="no"' help us not to
> redefine each time test_net.sh is loaded.
> ---
>   testcases/lib/test_net.sh | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
> index 7d82e8962..535a2abb3 100644
> --- a/testcases/lib/test_net.sh
> +++ b/testcases/lib/test_net.sh
> @@ -25,11 +25,10 @@ init_ltp_netspace()
>   	LHOST_IFACES=${LHOST_IFACES:-"ltp_ns_veth2"}
>   	RHOST_IFACES=${RHOST_IFACES:-"ltp_ns_veth1"}
>   
> -	if [ ! -f /var/run/netns/ltp_ns ]; then
> -		ROD ip net add ltp_ns
> -		ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
> -		ROD ip li set dev $RHOST_IFACES netns ltp_ns
> -	fi
> +	ip netns del ltp_ns 2>/dev/null
> +	ROD ip net add ltp_ns
> +	ROD ip li add name $RHOST_IFACES type veth peer name $LHOST_IFACES
> +	ROD ip li set dev $RHOST_IFACES netns ltp_ns
>   
>   	export TST_INIT_NETNS="no"
>   	export LTP_NETNS=${LTP_NETNS:-"ip netns exec ltp_ns"}


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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-22 10:47 ` [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Alexey Kodanev
@ 2016-12-22 13:01   ` Petr Vorel
  2016-12-22 14:15     ` Alexey Kodanev
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2016-12-22 13:01 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> On 12/22/2016 02:04 AM, Petr Vorel wrote:
> > Tested with:
> > TST_USE_NETNS=1 LHOST_IFACES=localpeer RHOST_IFACES=remotepeer \
> >    ./testscripts/network.sh -6

> Any good reason to do that?
Yes. Currently if you define LHOST_IFACES and/or RHOST_IFACES netns is defined for
ltp_ns_veth2 and ltp_ns_veth1, but then there are used new variables => it's not working.
Or have I overlooked something?

Kind regards,
Petr

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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-22 13:01   ` Petr Vorel
@ 2016-12-22 14:15     ` Alexey Kodanev
  2016-12-22 15:17       ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2016-12-22 14:15 UTC (permalink / raw)
  To: ltp

Hi,

On 12/22/2016 04:01 PM, Petr Vorel wrote:
> Hi Alexey,
>
>> On 12/22/2016 02:04 AM, Petr Vorel wrote:
>>> Tested with:
>>> TST_USE_NETNS=1 LHOST_IFACES=localpeer RHOST_IFACES=remotepeer \
>>>     ./testscripts/network.sh -6
>> Any good reason to do that?
> Yes. Currently if you define LHOST_IFACES and/or RHOST_IFACES netns is defined for
> ltp_ns_veth2 and ltp_ns_veth1, but then there are used new variables => it's not working.
> Or have I overlooked something?

I understand, but why do you need to re-define these interface names?

Thanks,
Alexey

>
> Kind regards,
> Petr


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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-22 14:15     ` Alexey Kodanev
@ 2016-12-22 15:17       ` Petr Vorel
  2016-12-22 17:55         ` Alexey Kodanev
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2016-12-22 15:17 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> > > Any good reason to do that?
> > Yes. Currently if you define LHOST_IFACES and/or RHOST_IFACES netns is defined for
> > ltp_ns_veth2 and ltp_ns_veth1, but then there are used new variables => it's not working.
> > Or have I overlooked something?

> I understand, but why do you need to re-define these interface names?
I don't need that, but if anyone does, it will have to find what's broken. This can happen
if you migrate from existing config (ssh/rsh) into netns.
IMHO the logic should be clever enough not to break things just due bad config (or let the
user to know about it).

Kind regards,
Petr

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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-22 15:17       ` Petr Vorel
@ 2016-12-22 17:55         ` Alexey Kodanev
  2016-12-23 10:54           ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2016-12-22 17:55 UTC (permalink / raw)
  To: ltp

On 12/22/2016 06:17 PM, Petr Vorel wrote:
> Hi Alexey,
>
>>>> Any good reason to do that?
>>> Yes. Currently if you define LHOST_IFACES and/or RHOST_IFACES netns is defined for
>>> ltp_ns_veth2 and ltp_ns_veth1, but then there are used new variables => it's not working.
>>> Or have I overlooked something?
>> I understand, but why do you need to re-define these interface names?
> I don't need that, but if anyone does, it will have to find what's broken. This can happen
> if you migrate from existing config (ssh/rsh) into netns.
> IMHO the logic should be clever enough not to break things just due bad config (or let the
> user to know about it).

Basically, if we set '*_IFACES' variables before the test, we have to 
make sure they contains the names of already existed interfaces. if 
someone moved from rsh config and left eth0 interface names... LTP must 
setup veth pair with this name? More likely the names will be the same 
and veth pair won't be created.

With current configuration, we could create ltp_ns namespace and setup 
our own interface(s) before the test (e.g. veth/br0 -> bond -> vxlan -> 
vlan ... etc), then run the tests with new names set (skipping default 
setup).

Thanks,
Alexey


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

* [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES
  2016-12-22 17:55         ` Alexey Kodanev
@ 2016-12-23 10:54           ` Petr Vorel
  0 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2016-12-23 10:54 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> Basically, if we set '*_IFACES' variables before the test, we have to make
> sure they contains the names of already existed interfaces. if someone moved
> from rsh config and left eth0 interface names... LTP must setup veth pair
> with this name? More likely the names will be the same and veth pair won't
> be created.
I'm sorry, you're right, I realized that afterwards. Forget about this patch.

> With current configuration, we could create ltp_ns namespace and setup our
> own interface(s) before the test (e.g. veth/br0 -> bond -> vxlan -> vlan ...
> etc), then run the tests with new names set (skipping default setup).
Sounds good, please do it.


Kind regards,
Petr

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

* [LTP] [PATCH 2/3] test_net.sh: delete netns before testing
  2016-12-22 11:08   ` Alexey Kodanev
@ 2016-12-23 11:04     ` Petr Vorel
  2017-01-09 12:09       ` Alexey Kodanev
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2016-12-23 11:04 UTC (permalink / raw)
  To: ltp

Hi Alexey,
> Hmm, could you describe the error you are getting?
> I cannot reproduce it in my environment.

> ...or is it about setting IPv6 address for the second time on the interface,
> because network.sh and test_net.sh are both using the same '-6' option?
> network_settings 1 TINFO : set local addr fd00:1:1:1::2/64
> RTNETLINK answers: File exists
I don't know why (probably bad setup or something on my side), but sometimes it even it's
ltp_ns setup (/var/run/netns/ltp_ns exists), ltp_ns_veth2 device is not available
(directory /sys/class/net/ltp_ns_veth2/ doesn't exist):

/opt/ltp/testscripts/network.sh -6
...
cmdline="ping01.sh -6"
contacts=""
analysis=exit
<<<test_output>>>
cat: /sys/class/net/ltp_ns_veth2/address: No such file or directory
...
ping01 1 TINFO : ping6 with 8 16 32 64 128 256 512 1024 2048 4064 ICMP packets
ping01 1 TFAIL : ping6 -c 3 -s 8 fd00:1:1:1::1 >/dev/null failed unexpectedly

> Moreover, it's not needed to set TST_USE_NETNS.
OK, do I understand that for netns I don't need to setup any variable?

Kind regards,
Petr

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

* [LTP] [PATCH 2/3] test_net.sh: delete netns before testing
  2016-12-23 11:04     ` Petr Vorel
@ 2017-01-09 12:09       ` Alexey Kodanev
  0 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2017-01-09 12:09 UTC (permalink / raw)
  To: ltp

Hi Petr,
On 23.12.2016 14:04, Petr Vorel wrote:
> Hi Alexey,
>> Hmm, could you describe the error you are getting?
>> I cannot reproduce it in my environment.
>> ...or is it about setting IPv6 address for the second time on the interface,
>> because network.sh and test_net.sh are both using the same '-6' option?
>> network_settings 1 TINFO : set local addr fd00:1:1:1::2/64
>> RTNETLINK answers: File exists
> I don't know why (probably bad setup or something on my side), but sometimes it even it's
> ltp_ns setup (/var/run/netns/ltp_ns exists), ltp_ns_veth2 device is not available
> (directory /sys/class/net/ltp_ns_veth2/ doesn't exist):

Have you tried upstream kernels?

> /opt/ltp/testscripts/network.sh -6
> ...
> cmdline="ping01.sh -6"
> contacts=""
> analysis=exit
> <<<test_output>>>
> cat: /sys/class/net/ltp_ns_veth2/address: No such file or directory
> ...
> ping01 1 TINFO : ping6 with 8 16 32 64 128 256 512 1024 2048 4064 ICMP packets
> ping01 1 TFAIL : ping6 -c 3 -s 8 fd00:1:1:1::1 >/dev/null failed unexpectedly
>
>> Moreover, it's not needed to set TST_USE_NETNS.
> OK, do I understand that for netns I don't need to setup any variable?

This configuration allows us to omit setting IP addresses, interface 
names and RHOST variables.

Best regards,
Alexey


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

* [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run
  2016-12-21 23:04 ` [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run Petr Vorel
@ 2017-01-19 17:50   ` Petr Vorel
  2017-01-20 16:14     ` Alexey Kodanev
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2017-01-19 17:50 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> netns can be set by test_net.sh when RHOST is unset, but user wants to
> use ssh, so it should be first tested.

> Tested with:
> TST_USE_SSH=1 ./testscripts/network.sh -6

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Even it's configuration error, we should handle it as before netns was user
> warned about config error.
> ---
>  testcases/lib/test_net.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

> diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
> index 535a2abb3..8fc14c588 100644
> --- a/testcases/lib/test_net.sh
> +++ b/testcases/lib/test_net.sh
> @@ -88,12 +88,12 @@ tst_rhost_run()

>  	local output=
>  	local ret=0
> -	if [ -n "$TST_USE_SSH" ]; then
> -		output=`ssh -n -q $user@$RHOST "sh -c \
> -			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
> -	elif [ -n "$TST_USE_NETNS" ]; then
> +	if [ -n "$TST_USE_NETNS" ]; then
>  		output=`$LTP_NETNS sh -c \
>  			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
> +	elif [ -n "$TST_USE_SSH" ]; then
> +		output=`ssh -n -q $user@$RHOST "sh -c \
> +			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>  	else
>  		output=`rsh -n -l $user $RHOST "sh -c \
>  			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`

How about this patch? (just this one, please ignore 1st and 2nd) NACK?


Kind regards,
Petr

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

* [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run
  2017-01-19 17:50   ` Petr Vorel
@ 2017-01-20 16:14     ` Alexey Kodanev
  2017-01-23  9:57       ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2017-01-20 16:14 UTC (permalink / raw)
  To: ltp


On 01/19/2017 08:50 PM, Petr Vorel wrote:
>>   	local output=
>>   	local ret=0
>> -	if [ -n "$TST_USE_SSH" ]; then
>> -		output=`ssh -n -q $user@$RHOST "sh -c \
>> -			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>> -	elif [ -n "$TST_USE_NETNS" ]; then
>> +	if [ -n "$TST_USE_NETNS" ]; then
>>   		output=`$LTP_NETNS sh -c \
>>   			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
>> +	elif [ -n "$TST_USE_SSH" ]; then
>> +		output=`ssh -n -q $user@$RHOST "sh -c \
>> +			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>>   	else
>>   		output=`rsh -n -l $user $RHOST "sh -c \
>>   			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
> How about this patch? (just this one, please ignore 1st and 2nd) NACK?

With this patch, if user wants to use ssh (explicitly set this variable) 
but forgot
to set remote host variable, the test will continue with netns and the user
might not even notice it.

Thanks,
Alexey

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

* [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run
  2017-01-20 16:14     ` Alexey Kodanev
@ 2017-01-23  9:57       ` Petr Vorel
  0 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-01-23  9:57 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> With this patch, if user wants to use ssh (explicitly set this variable) but
> forgot
> to set remote host variable, the test will continue with netns and the user
> might not even notice it.
Right, this makes sense to have it this way.


Kind regards,
Petr

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

end of thread, other threads:[~2017-01-23  9:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 23:04 [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Petr Vorel
2016-12-21 23:04 ` [LTP] [PATCH 2/3] test_net.sh: delete netns before testing Petr Vorel
2016-12-22 11:08   ` Alexey Kodanev
2016-12-23 11:04     ` Petr Vorel
2017-01-09 12:09       ` Alexey Kodanev
2016-12-21 23:04 ` [LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run Petr Vorel
2017-01-19 17:50   ` Petr Vorel
2017-01-20 16:14     ` Alexey Kodanev
2017-01-23  9:57       ` Petr Vorel
2016-12-22 10:47 ` [LTP] [PATCH 1/3] test_net.sh: fix netns when defined LHOST_IFACES or RHOST_IFACES Alexey Kodanev
2016-12-22 13:01   ` Petr Vorel
2016-12-22 14:15     ` Alexey Kodanev
2016-12-22 15:17       ` Petr Vorel
2016-12-22 17:55         ` Alexey Kodanev
2016-12-23 10:54           ` Petr Vorel

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.