Skip to contentSkip to conversation

network: load test_net.sh after getopts

PATCH New Petr Vorel 2 participants 2 messages Nov 7, 2016 – Nov 9, 2016

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 network: load test_net.sh after getopts

We shouldn't ask rsh/ssh password or require having set ssh pub keys just for displaying help.

---
 testscripts/network.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testscripts/network.sh +2 -2
index 66bacef..fea2f68 100755
@@ -11,8 +11,6 @@ if [ $? -eq 0 ]; then
 	export LTPROOT=${PWD}
 fi
 
-. test_net.sh
-
 export TMPDIR=/tmp/netpan-$$
 mkdir -p $TMPDIR
 CMDFILE=${TMPDIR}/network.tests
@@ -81,6 +79,8 @@ if [ "$OPTIND" -eq 1 ]; then
 	exit 1
 fi
 
+. test_net.sh
+
 rm -f $CMDFILE
 
 for t in $TEST_CASES; do
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 network: load test_net.sh after getopts

Hi,

Quoted 22 lines · Petr Vorel

We shouldn't ask rsh/ssh password or require having set ssh pub keys just for displaying help.

---
  testscripts/network.sh | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
testscripts/network.sh +0 -2
index 66bacef..fea2f68 100755
@@ -11,8 +11,6 @@ if [ $? -eq 0 ]; then
  	export LTPROOT=${PWD}
  fi
 
-. test_net.sh
-
  export TMPDIR=/tmp/netpan-$$
  mkdir -p $TMPDIR
  CMDFILE=${TMPDIR}/network.tests

testscripts/network.sh if [ "$OPTIND" -eq 1 ]; then · line 83

Quoted 5 lines
testscripts/network.sh +2 -0
@@ -81,6 +79,8 @@ if [ "$OPTIND" -eq 1 ]; then
  	exit 1
  fi
 
+. test_net.sh
+

Agree, but we should reset TCID and TST_TOTAL after test_net.sh inclusion (not before).
May be something like this where they were moved close to each other:

@@ -81,6 +79,8 @@ if [ "$OPTIND" -eq 1 ]; then
exit 1
fi

+TST_TOTAL=1
+TCID="network_settings"
+
+. test_net.sh
+
+# Reset variables.
+# Don't break the tests which are using 'testcases/lib/cmdlib.sh' +export TCID=
+export TST_LIB_LOADED=
+
rm -f $CMDFILE

Best regards,
Alexey

Quoted 3 lines
testscripts/network.sh +0 -0
  rm -f $CMDFILE
 
  for t in $TEST_CASES; do