[LTP] [COMMITTED][PATCH] tst_net.sh: Fix unintended tst_require_root call in shell new API

Petr Vorel pvorel@suse.cz
Mon Sep 2 15:42:13 CEST 2019


for cases where tst_require_root_ is called by root (by evaluating ||):
/opt/ltp/testcases/bin/tst_net.sh: line 102: tst_require_root: command not found

NOTE: 4552972e5 ("tst_test.sh: Always return 0 from
_tst_require_root()") was intended to fix it, but it didn't.

Fixes: 8722680b6 ("tst_net.sh: Use _tst_require_root instead of TST_NEEDS_ROOT=1")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

sorry for useless 4552972e5 commit.

Kind regards,
Petr

 testcases/lib/tst_net.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 6a9d51b81..6c3ae708d 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -99,7 +99,11 @@ tst_brk_()
 }
 tst_require_root_()
 {
-	[ -z "$TST_USE_LEGACY_API" ] && _tst_require_root || tst_require_root
+	if [ -z "$TST_USE_LEGACY_API" ]; then
+		_tst_require_root
+	else
+		tst_require_root
+	fi
 }
 
 init_ltp_netspace()
-- 
2.22.1



More information about the ltp mailing list