Correct the checking of return values. 77/4177/2
authorTibor Frank <tifrank@cisco.com>
Thu, 8 Dec 2016 12:58:32 +0000 (13:58 +0100)
committerPeter Mikus <pmikus@cisco.com>
Mon, 12 Dec 2016 06:23:07 +0000 (06:23 +0000)
Change-Id: Icf9f37e0ab0ce4eef3532d3b18f82e9dc5f8f999
Signed-off-by: Tibor Frank <tifrank@cisco.com>
bootstrap-vpp-honeycomb.sh
bootstrap-vpp-verify-semiweekly.sh
bootstrap-vpp-verify-weekly.sh
bootstrap.sh

index 66d72b0..41bb4db 100755 (executable)
@@ -162,7 +162,7 @@ VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
     "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "VIRL simulation start failed"
     exit ${retval}
 fi
@@ -184,7 +184,7 @@ scp ${SSH_OPTIONS} \
     topologies/enabled/topology.yaml
 
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "Failed to copy topology file from VIRL simulation"
     exit ${retval}
 fi
index c2ed4ea..e6c48ec 100644 (file)
@@ -199,7 +199,7 @@ VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
     "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_VIRL[@]}")
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "VIRL simulation start failed"
     exit ${retval}
 fi
@@ -221,7 +221,7 @@ scp ${SSH_OPTIONS} \
     topologies/enabled/topology_VIRL.yaml
 
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "Failed to copy topology file from VIRL simulation"
     exit ${retval}
 fi
index 2066704..8fd6ff2 100644 (file)
@@ -161,7 +161,7 @@ VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
     "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "VIRL simulation start failed"
     exit ${retval}
 fi
@@ -183,7 +183,7 @@ scp ${SSH_OPTIONS} \
     topologies/enabled/topology.yaml
 
 retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
     echo "Failed to copy topology file from VIRL simulation"
     exit ${retval}
 fi
index f3564ec..286ec38 100755 (executable)
@@ -169,7 +169,7 @@ for index in "${!VIRL_SERVER[@]}"; do
         scp ${SSH_OPTIONS} *.deb \
         ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
 
-         result=$?
+        result=$?
         if [ "${result}" -ne "0" ]; then
             echo "Failed to copy VPP deb files to VIRL host ${VIRL_SERVER[${index}]}"
             echo ${result}
@@ -199,7 +199,7 @@ for index in "${!VIRL_SERVER[@]}"; do
         ${VIRL_USERNAME}@${VIRL_SERVER[${index}]} \
         "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
     retval=$?
-    if [ "$?" -ne "0" ]; then
+    if [ ${retval} -ne "0" ]; then
         echo "VIRL simulation start failed on ${VIRL_SERVER[${index}]}"
         exit ${retval}
     fi
@@ -218,7 +218,7 @@ for index in "${!VIRL_SERVER[@]}"; do
         topologies/enabled/topology${index}.yaml
 
     retval=$?
-    if [ "$?" -ne "0" ]; then
+    if [ ${retval} -ne "0" ]; then
         echo "Failed to copy topology file from VIRL simulation nr. ${index} on VIRL server ${VIRL_SERVER[${index}]}"
         exit ${retval}
     fi