Resolve ShellCheck v0.4.7 linting in integration 97/66997/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 10 Jan 2018 00:04:22 +0000 (19:04 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 10 Jan 2018 00:04:24 +0000 (19:04 -0500)
Change-Id: I1f7fbd407634367342587ede2fdeecd3699d3af3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
.coafile
jjb/integration/distribution/distribution-check-bootup.sh
jjb/integration/distribution/distribution-deploy-verify.sh
jjb/integration/integration-deploy-openstack-run-test.sh
jjb/integration/integration-get-slave-addresses.sh
jjb/integration/update-csit-tests.sh

index 60e83070f29ef42c5050e595d732c8608e4a3afa..47cf0afb0b62d28f3efad57549d4f6ee72186348 100644 (file)
--- a/.coafile
+++ b/.coafile
@@ -31,7 +31,6 @@ files = **.sh
 ignore = .git/**,
     .tox/**,
     jjb/global-jjb/**,
-    jjb/integration/**,
     jenkins-scripts/*-local-env.sh
 shell = bash
 indent_size = 4
index d4ffea9cdd3bcff8939ddbbbdddb799aa92269f9..9f0943ca007f8add42d99d8f3e169f9b0336a735 100644 (file)
@@ -151,9 +151,9 @@ echo "Kill controller"
 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
 
 echo "Bug 4628: Detecting misplaced config files"
-pushd "${WORKSPACE}/${BUNDLEFOLDER}"
+pushd "${WORKSPACE}/${BUNDLEFOLDER}" || exit
 XMLS_FOUND="$(echo *.xml)"
-popd
+popd || exit
 if [ "$XMLS_FOUND" != "*.xml" ]; then
     echo "Bug 4628 confirmed."
     ## TODO: Uncomment the following when ODL is fixed, to guard against regression.
index e3e60a5a90a9fdd3ce5049dbc216fdfd89079e32..f0f2fbb6d5e46d43c90ef9d5c1c858c82f0f22a9 100644 (file)
@@ -129,9 +129,9 @@ echo "Kill controller"
 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
 
 echo "Bug 4628: Detecting misplaced config files"
-pushd "${WORKSPACE}/${BUNDLEFOLDER}"
+pushd "${WORKSPACE}/${BUNDLEFOLDER}" || exit
 XMLS_FOUND=`echo *.xml`
-popd
+popd || exit
 if [ "$XMLS_FOUND" != "*.xml" ]; then
     echo "Bug 4628 confirmed."
     ## TODO: Uncomment the following when ODL is fixed, to guard against regression.
index a91acfaad4d0d76ffe341551d2c7947e65d51866..5ff94873c351cf2c0e203c33e84b3af9b386fdc8 100644 (file)
@@ -6,7 +6,7 @@
 source ${ROBOT_VENV}/bin/activate
 PYTHON="${ROBOT_VENV}/bin/python"
 SSH="ssh -t -t"
-ADMIN_PASSWORD=admin
+ADMIN_PASSWORD="admin"
 
 # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level
 echo "showing recent changes that made it in to the distribution used by this job"
@@ -352,6 +352,7 @@ EOF
 
 function configure_haproxy_for_neutron_requests() {
     MGRIP=$1
+    # shellcheck disable=SC2206
     ODL_IPS=(${2//,/ })
 
     cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
@@ -865,7 +866,7 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
     ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!CONTROLIP} "ps -ef | grep stack.sh"
     ssh ${!CONTROLIP} "ls -lrt /opt/stack/devstack/nohup.out"
-    os_node_list+=(${!CONTROLIP})
+    os_node_list+=("${!CONTROLIP}")
     # Workaround for stable/newton jobs
     # TODO: can this be removed now?
     if [ "${ODL_ML2_BRANCH}" == "stable/newton" ]; then
@@ -926,7 +927,7 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
     echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
     ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"
-    os_node_list+=(${!COMPUTEIP})
+    os_node_list+=("${!COMPUTEIP}")
 done
 
 echo "nodelist: ${os_node_list[*]}"
@@ -1054,6 +1055,7 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
 
     # ipsec support
     if [ "${IPSEC_VXLAN_TUNNELS_ENABLED}" == "yes" ]; then
+        # shellcheck disable=SC2206
         ALL_NODES=(${!CONTROLIP} ${COMPUTE_IPS[*]})
         for ((inx_ip1=0; inx_ip1<$((${#ALL_NODES[@]} - 1)); inx_ip1++)); do
             for ((inx_ip2=$((inx_ip1 + 1)); inx_ip2<${#ALL_NODES[@]}; inx_ip2++)); do
index 28278b1f5b0410f180a9660bdee91c4ef6cac419..8f01f54dbd9467a8bdf307f9d698c0a329926e44 100644 (file)
@@ -12,7 +12,7 @@ OPENSTACK_CONTROLLERS=()
 OPENSTACK_VENV="/tmp/v/openstack"
 # shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091
 source $OPENSTACK_VENV/bin/activate
-
+# shellcheck disable=SC2207
 ADDR=($(openstack stack show -f json -c outputs "$STACK_NAME" | \
        jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]'))
 
index 6522677076f60e63b4162822efc158e93bb63991..a56fd02a5ea8fcbd1958554154b211c91b914526 100644 (file)
@@ -14,6 +14,7 @@ jobs_file=$(mktemp)
 search_string="csit"
 
 wget --quiet -O "$jobs_file" https://jenkins.opendaylight.org/$SILO/api/xml
+# shellcheck disable=SC2207
 jobs=($(xmlstarlet sel -t -m '//hudson/job' \
     -n -v 'name' "$jobs_file" | grep $search_string | grep $STREAM))