refactored run.sh and changed its execution mode 09/16009/1
authorUlas Kozat <ulas.kozat@gmail.com>
Mon, 27 Jun 2016 18:38:09 +0000 (11:38 -0700)
committerUlas Kozat <ulas.kozat@gmail.com>
Mon, 27 Jun 2016 18:38:09 +0000 (11:38 -0700)
Change-Id: I761bf4b4995e4fc19253388af881df9f532c5cc1
Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
tests/run.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b9ec9ae..695f0da
@@ -55,8 +55,21 @@ clean_directories() {
   fi
 }
 
+cleanup() {
+  set +e
+  echo "cleanup..."
+  
+  echo "Stopping Domino Client 1..."
+  stop_client1
+
+  echo "Stopping Domino Server..."
+  stop_server
+}
+
 echo "domino/tests/run.sh has been executed."
 
+trap cleanup EXIT
+
 echo "Cleaning residue files and folders from previous runs..."
 clean_directories
 
@@ -97,11 +110,11 @@ python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1"
 
 sleep 5
 
-echo "Stopping Domino Client 1..."
-stop_client1
+#echo "Stopping Domino Client 1..."
+#stop_client1
 
-echo "Stopping Domino Server..."
-stop_server
+#echo "Stopping Domino Server..."
+#stop_server
 
 cut -d " " -f 4- "$client1_log" > file1
 #will use the form below to declare success or failure