Skip to contentSkip to conversation

route{4, 6}-rmmod: Declare variables before using them

PATCH New Feiyu Zhu 2 participants 2 messages Sep 10, 2020

lore
Share & tools
lore

Feiyu Zhu

author
#0 lore raw

PATCH v2 1/1 route{4, 6}-rmmod: Declare variables before using them

When running route4-rmmod case, it reports the following error:
/opt/ltp/testcases/bin/route4-rmmod: line 100: lhost_module: unbound variable.

It fails because "set -u" is used in .testcases/lib/cmdlib.sh and "set -u" treats unset variables and parameters as errors.

---
 testcases/network/stress/route/route4-rmmod | 3 +++
 testcases/network/stress/route/route6-rmmod | 3 +++
 2 files changed, 6 insertions(+)
testcases/network/stress/route/route4-rmmod +3 -0
index 5947bb3..7aa1958 100644
@@ -125,6 +125,9 @@ do_setup()
 	exit $TST_TOTAL
     fi
 
+    # The module name of the interface at the local host
+    lhost_module=
+
     # Make sure to clean up
     do_cleanup
 
testcases/network/stress/route/route6-rmmod +3 -0
index 73f26f2..765a57a 100644
@@ -121,6 +121,9 @@ do_setup()
 	exit $TST_TOTAL
     fi
 
+    # The module name of the interface at the local host
+    lhost_module=
+
     # Make sure to clean up
     do_cleanup
 
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 1/1 route{4, 6}-rmmod: Declare variables before using them

Hi Feiyu,

Quoted 5 lines

When running route4-rmmod case, it reports the following error:
/opt/ltp/testcases/bin/route4-rmmod: line 100: lhost_module: unbound variable.

It fails because "set -u" is used in .testcases/lib/cmdlib.sh and "set -u" treats unset variables and parameters as errors.

Thanks a lot for update, merged.

Kind regards,
Petr