bugfix: ssh to one OS instance via floating ip
[bottlenecks.git] / testsuites / rubbos / run_rubbos.py
index 3c18999..11b3f96 100755 (executable)
@@ -265,6 +265,23 @@ def rubbos_run():
     subprocess.call(cmd, shell=True)
 
     ssh_args = "-o StrictHostKeyChecking=no -o BatchMode=yes -i " + Bottlenecks_repo_dir + "/utils/infra_setup/bottlenecks_key/bottlenecks_key "
+    print "############### Test #################"
+    print "## Ping test:"
+    cmd = "ping -c 5 " + control_public_ip
+    print cmd
+    subprocess.call(cmd, shell=True)
+    print "## ssh date test:"
+    cmd = "ssh " + ssh_args + " ubuntu@" + control_public_ip + ' "date"'
+    print cmd
+    subprocess.call(cmd, shell=True)
+    print "## neutruon net-list:"
+    subprocess.call("neutron net-list", shell=True)
+    print "## neutron subnet-list:"
+    subprocess.call("neutron subnet-list", shell=True)
+    print "## neutron security-group-list:"
+    subprocess.call("neutron security-group-list", shell=True)
+    print "############### Test #################"
+
     cmd = "scp " + ssh_args + "rubbos.conf ubuntu@" + control_public_ip + ":/home/ubuntu/"
     print "Exec shell: " + cmd
     subprocess.call(cmd, shell=True)
@@ -274,15 +291,16 @@ def rubbos_run():
     subprocess.call(cmd, shell=True)
 
     # call remote run_rubbos_internal.sh
-    cmd = "ssh " + ssh_args + " ubuntu@" + control_public_ip + ' sudo /home/ubuntu/run_rubbos_internal.sh /home/ubuntu/rubbos.conf /home/ubuntu/btnks-results'
+    cmd = "ssh " + ssh_args + " ubuntu@" + control_public_ip + ' "sudo /home/ubuntu/run_rubbos_internal.sh /home/ubuntu/rubbos.conf /home/ubuntu/btnks-results" '
     print "Exec shell: " + cmd
     subprocess.call(cmd, shell=True)
-    cmd = "scp " + ssh_args + " ubuntu@" + control_public_ip + "/home/ubuntu/btnks-results/rubbos.out ./rubbos.out"
+    cmd = "scp " + ssh_args + " ubuntu@" + control_public_ip + ":/home/ubuntu/btnks-results/rubbos.out ./rubbos.out"
     print "Exec shell: " + cmd
     subprocess.call(cmd, shell=True)
     if os.path.exists("rubbos.out") == False:
+        print "Failed to fetch results from the rubbos_control node!"
         return False
-    
+
     with open("rubbos.out") as f:
         lines = f.readlines()
         print "Rubbos results:"
@@ -296,14 +314,15 @@ def main():
     global image_url
     Bottlenecks_repo_dir = "/home/opnfv/bottlenecks"      # same in Dockerfile, docker directory
 
-    image_url = 'http://artifacts.opnfv.org/bottlenecks/rubbos/trusty-server-cloudimg-amd64-btnks.img'
+    #image_url = 'http://artifacts.opnfv.org/bottlenecks/rubbos/trusty-server-cloudimg-amd64-btnks.img'
+    image_url = 'http://artifacts.opnfv.org/bottlenecks/rubbos/bottlenecks-trusty-server.img'
 
     if not (args.conf):
        logger.error("Configuration files are not set for testcase")
        exit(-1)
     else:
        Heat_template = args.conf
-    
     master_user_data=""
     agent_user_data=""
     with open(Bottlenecks_repo_dir+"/utils/infra_setup/user_data/p-master-user-data") as f: