Add custom_shard for 1node
[releng/builder.git] / jjb / integration / integration-deploy-controller-run-test.sh
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"