-echo "domino/tests/run_multinode.sh has been executed."
-
-if [ "$IS_IPandKEY_CONFIGURED" = "true" ]; then
- trap cleanup EXIT
-
- cleanup
- prepare_testenv
- launch_domino
-
-
- echo "Test Heartbeat"
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT heartbeat'"
- sleep 1
-
- echo "Test Subscribe API"
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot -l tosca.policies.Placement:properties:region:nova-1'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-2'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop OVERWRITE'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop DELETE'"
- sleep 1
-
- echo "Test Publish API"
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'"
-
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement.Geolocation:properties:region:us-west-1'"
- sleep 1
- ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'"
-
- echo "done"
-
+echo "domino/tests/run.sh has been executed."
+
+trap cleanup EXIT
+
+echo "Terminating any running Domino Clients..."
+stop_clients
+
+echo "Terminating any running Domino Servers..."
+stop_server
+sleep 1
+
+echo "Cleaning residue files and folders from previous runs..."
+clean_directories
+sleep 1
+
+echo "Installing dependencies..."
+install_dependency
+sleep 1
+
+echo "Launching Domino Server..."
+start_server
+sleep 1
+
+echo "Launching Domino Client 1..."
+start_client1
+sleep 1
+
+echo "Launching Domino Client 2..."
+start_client2
+sleep 1
+
+echo "Test Heartbeat"
+python domino-cli.py $CLIENT1_CLIPORT heartbeat
+sleep 1
+
+echo "Test Subscribe API"
+python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot \
+ -l tosca.policies.Placement:properties:region:nova-1
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe \
+ -l tosca.policies.Placement:properties:region:nova-2
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe \
+ -l tosca.policies.Placement:properties:region:nova-3 \
+ --lop OVERWRITE
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe \
+ -l tosca.policies.Placement:properties:region:nova-3 \
+ --lop DELETE
+sleep 1
+
+echo "Test Publish API"
+python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1"
+
+sleep 1
+python domino-cli.py $CLIENT1_CLIPORT subscribe \
+ -l tosca.policies.Placement.Geolocation:properties:region:us-west-1
+sleep 1
+python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"
+sleep 1
+TUID=$(python domino-cli.py $CLIENT2_CLIPORT list-tuids | cut -c3-34)
+echo $TUID
+sleep 1
+python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" -k "$TUID"
+
+#echo "Stopping Domino Client 1..."
+#stop_client1
+
+#echo "Stopping Domino Server..."
+#stop_server
+
+cut -d " " -f 4- "$client1_log" > file1
+cut -d " " -f 4- "$client2_log" > file2
+#will use the form below to declare success or failure
+set +e
+
+diff -q file1 "$test1_reffile1" 1>/dev/null
+if [[ $? == "0" ]]
+then
+ echo "Log1 PASS"