[COMMITTED] tst_net.sh: Don't require root when netns was setup externally
diff mbox series

Message ID 20191017140410.6810-1-pvorel@suse.cz
State Accepted
Delegated to: Petr Vorel
Headers show
Series
  • [COMMITTED] tst_net.sh: Don't require root when netns was setup externally
Related show

Commit Message

Petr Vorel Oct. 17, 2019, 2:04 p.m. UTC
+ also don't require ip in that case.
+ remove unneeded '='

Fixes: e38d7c439 ("test_net.sh: Check for ip command")

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

Patch
diff mbox series

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 4be1bc0fc..2741d9bca 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -108,12 +108,12 @@  tst_require_root_()
 
 init_ltp_netspace()
 {
-	tst_test_cmds ip
-	tst_require_root_
-
-	local pid=
+	local pid
 
 	if [ ! -f /var/run/netns/ltp_ns -a -z "$LTP_NETNS" ]; then
+		tst_test_cmds ip
+		tst_require_root_
+
 		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