[LTP] [COMMITTED][PATCH] tst_net.sh: Don't require root when netns was setup externally
Petr Vorel
pvorel@suse.cz
Thu Oct 17 16:04:10 CEST 2019
+ 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(-)
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
--
2.23.0
More information about the ltp
mailing list