Use defined tools ips
[integration/test.git] / csit / scripts / set_unique_node_uuid.sh
index 1d753734cf55a08522a33c34aae28f8a154e9d83..b6e34ba7317446475d8fe1eaa4bed51c84bcf493 100644 (file)
@@ -1,16 +1,15 @@
 #!/bin/bash
 
 cat > ${WORKSPACE}/system-ovs-restart.sh <<EOF
-
 sudo rm -rf /etc/openvswitch/conf.db
 sudo service openvswitch-switch restart
-
 EOF
-scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_2_IP}:/tmp/
-ssh ${TOOLS_SYSTEM_2_IP} 'sudo bash /tmp/system-ovs-restart.sh'
-scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_3_IP}:/tmp/
-ssh ${TOOLS_SYSTEM_3_IP} 'sudo bash /tmp/system-ovs-restart.sh'
-scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_4_IP}:/tmp/
-ssh ${TOOLS_SYSTEM_4_IP} 'sudo bash /tmp/system-ovs-restart.sh'
-scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_5_IP}:/tmp/
-ssh ${TOOLS_SYSTEM_5_IP} 'sudo bash /tmp/system-ovs-restart.sh'
+
+echo "Copying and running running set_unique_node_uuid.sh on tools system(s)"
+for i in `seq 2 ${NUM_TOOLS_SYSTEM}`; do
+    ip_var=TOOLS_SYSTEM_${i}_IP
+    ip=${!ip_var}
+    echo "Restarting openswitch to create unique node uuid"
+    scp ${WORKSPACE}/system-ovs-restart.sh ${ip}:/tmp/
+    ssh ${ip} 'sudo bash /tmp/system-ovs-restart.sh'
+done