Merge "Move "read_yaml_file" to common.yaml_loader"
[yardstick.git] / yardstick / benchmark / scenarios / compute / qemu_migrate_benchmark.bash
index 5520981..d95e914 100644 (file)
@@ -14,6 +14,7 @@ set -e
 # Commandline arguments
 
 src=$2
+dst=$3
 dst_ip=$4
 migrate_to_port=$5
 max_down_time=$6
@@ -22,14 +23,15 @@ OUTPUT_FILE=/tmp/output-qemu.log
 
 do_migrate()
 {
-#       local src=`echo $OPTIONS | cut -d ':' -f 2 | cut -d ',' -f 1`
+        echo "Execution of Live Migration"
+
         echo "info status" | nc -U $src
         # with no speed limit
-        echo "migrate_set_speed 0" |nc -U $src
+        echo "migrate_set_speed 0" | nc -U $src
         # set the expected max downtime
-        echo "migrate_set_downtime ${max_down_time}" |nc -U $src
+        echo "migrate_set_downtime ${max_down_time}" | nc -U $src
         # start live migration
-        echo "migrate -d tcp:${dst_ip}:$migrate_to_port" |nc -U $src
+        echo "migrate -d tcp:${dst_ip}:${migrate_to_port}" | nc -U $src
         # wait until live migration completed
         status=""
         while [  "${status}" == ""  ]
@@ -38,14 +40,20 @@ do_migrate()
                 echo ${status}
                 sleep 1;
         done
-} >/dev/null
+
+        echo "End of Live Migration"
+
+} > /dev/null
 
 output_qemu()
 {
+        echo "Checking status of Migration"
         # print detail information
         echo "info migrate" | nc -U $src
         echo "quit" | nc -U $src
+        echo "quit" | nc -U $dst
         sleep 5
+        echo "Migration executed successfully"
 
 } > $OUTPUT_FILE
 
@@ -60,9 +68,18 @@ echo -e "{ \
         \"setuptime\":\"$setuptime\" \
          }"
 }
+
 # main entry
 main()
 {
+    # Perform LiveMigration
     do_migrate
+
+    # LiveMigration Status
+    output_qemu
+
+    # LiveMigration JSON output
+    output_json
 }
+
 main