Add custom_shard for 1node 97/75197/4
authorSam Hague <shague@redhat.com>
Tue, 14 Aug 2018 19:36:43 +0000 (15:36 -0400)
committerSam Hague <shague@redhat.com>
Wed, 15 Aug 2018 12:13:04 +0000 (08:13 -0400)
Change-Id: Id9d6d8964dad78a02825aa6c0107395d237d02f3
Signed-off-by: Sam Hague <shague@redhat.com>
jjb/integration/common-functions.sh
jjb/integration/integration-configure-clustering.sh
jjb/integration/integration-deploy-controller-run-test.sh

index 4695ccdbe470bda2139c3739f16d12dbff356e58..a3986672cf4b24ce51660b2883214c9ff62c486a 100644 (file)
@@ -582,3 +582,26 @@ EOF
         echo "tempest results not found in ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0"
     fi
 } # collect_netvirt_logs()
+
+# Utility function for joining strings.
+function join() {
+    delim=' '
+    final=$1; shift
+
+    for str in "$@" ; do
+        final=${final}${delim}${str}
+    done
+
+    echo ${final}
+}
+
+function get_nodes_list() {
+    # Create the string for nodes
+    for i in `seq 1 ${NUM_ODL_SYSTEM}` ; do
+        CONTROLLERIP=ODL_SYSTEM_${i}_IP
+        nodes[$i]=${!CONTROLLERIP}
+    done
+
+    nodes_list=$(join "${nodes[@]}")
+    echo ${nodes_list}
+}
index 619f3c311853fefca6fd877d764e1eacb9f1ec39..1365e9bfde32dfd60d0021030441316264ebb6e6 100644 (file)
@@ -20,27 +20,7 @@ fi
 # and ending in newline. Remove all that.
 ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'`
 
-# Utility function for joining strings.
-function join {
-    delim=' '
-    final=$1; shift
-
-    for str in "$@" ; do
-        final=${final}${delim}${str}
-    done
-
-    echo ${final}
-}
-
-# Create the string for nodes
-for i in `seq 1 ${NUM_ODL_SYSTEM}` ; do
-    CONTROLLERIP=ODL_SYSTEM_${i}_IP
-    nodes[$i]=${!CONTROLLERIP}
-done
-
-nodes_list=$(join "${nodes[@]}")
-
-echo ${nodes_list}
+nodes_list=$(get_nodes_list)
 
 run_plan "script"
 
index 9fc28a881875a65597efdcb7d9c778bd5521bdac..63de9a8464f2953323e88a91423a10e8bdc96779 100755 (executable)
@@ -30,6 +30,8 @@ echo "ACTUALFEATURES: ${ACTUALFEATURES}"
 SPACE_SEPARATED_FEATURES=$(echo "${ACTUALFEATURES}" | tr ',' ' ')
 echo "SPACE_SEPARATED_FEATURES: ${SPACE_SEPARATED_FEATURES}"
 
+nodes_list=$(get_nodes_list)
+
 run_plan "script"
 
 cat > ${WORKSPACE}/configuration-script.sh <<EOF
@@ -72,27 +74,24 @@ set_java_vars "${JAVA_HOME}" "${CONTROLLERMEM}" "${MEMCONF}"
 echo "Listing all open ports on controller system..."
 netstat -pnatu
 
-if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
-
-    # Copy shard file if exists
-    if [ -f /tmp/custom_shard_config.txt ]; then
-        echo "Custom shard config exists!!!"
-        echo "Copying the shard config..."
-        cp /tmp/custom_shard_config.txt /tmp/${BUNDLEFOLDER}/bin/
-    fi
+# Copy shard file if exists
+if [ -f /tmp/custom_shard_config.txt ]; then
+    echo "Custom shard config exists!!!"
+    echo "Copying the shard config..."
+    cp /tmp/custom_shard_config.txt /tmp/${BUNDLEFOLDER}/bin/
+fi
 
-    echo "Configuring cluster"
-    /tmp/${BUNDLEFOLDER}/bin/configure_cluster.sh \$1 \$2
+echo "Configuring cluster"
+/tmp/${BUNDLEFOLDER}/bin/configure_cluster.sh \$1 ${nodes_list}
 
-    echo "Dump akka.conf"
-    cat ${AKKACONF}
+echo "Dump akka.conf"
+cat ${AKKACONF}
 
-    echo "Dump modules.conf"
-    cat ${MODULESCONF}
+echo "Dump modules.conf"
+cat ${MODULESCONF}
 
-     echo "Dump module-shards.conf"
-     cat ${MODULESHARDSCONF}
-fi
+ echo "Dump module-shards.conf"
+ cat ${MODULESHARDSCONF}
 
 EOF
 # cat > ${WORKSPACE}/configuration-script.sh <<EOF
@@ -185,26 +184,14 @@ exit_on_log_file_message 'server is unhealthy'
 EOF
 # cat > ${WORKSPACE}/post-startup-script.sh <<EOF
 
-[ "$NUM_OPENSTACK_SITES" ] || NUM_OPENSTACK_SITES=1
-NUM_ODLS_PER_SITE=$((NUM_ODL_SYSTEM / NUM_OPENSTACK_SITES))
-for i in `seq 1 ${NUM_OPENSTACK_SITES}`
+# Copy over the configuration script and configuration files to each controller
+# Execute the configuration script on each controller.
+for i in `seq 1 ${NUM_ODL_SYSTEM}`
 do
-    # Get full list of ODL nodes for this site
-    odl_node_list=
-    for j in `seq 1 ${NUM_ODLS_PER_SITE}`
-    do
-        odl_ip=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
-        odl_node_list="${odl_node_list} ${!odl_ip}"
-    done
-
-    for j in `seq 1 ${NUM_ODLS_PER_SITE}`
-    do
-        odl_ip=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
-        # Copy over the config script to controller and execute it (parameters are used only for cluster)
-        echo "Execute the configuration script on controller ${!odl_ip} for index $j with node list ${odl_node_list}"
-        scp ${WORKSPACE}/configuration-script.sh ${!odl_ip}:/tmp
-        ssh ${!odl_ip} "bash /tmp/configuration-script.sh ${j} '${odl_node_list}'"
-    done
+    CONTROLLERIP=ODL_SYSTEM_${i}_IP
+    echo "Configuring member-${i} with IP address ${!CONTROLLERIP}"
+    scp ${WORKSPACE}/configuration-script.sh ${!CONTROLLERIP}:/tmp/
+    ssh ${!CONTROLLERIP} "bash /tmp/configuration-script.sh ${i}"
 done
 
 run_plan "config"