Merge "blacklist.txt file format corrected"
[functest.git] / testcases / features / sfc / sfc.py
index c4d7fd7..bdd2790 100755 (executable)
@@ -8,7 +8,6 @@ import functest.utils.functest_utils as ft_utils
 import functest.utils.openstack_utils as os_utils
 import paramiko
 
-
 parser = argparse.ArgumentParser()
 
 parser.add_argument("-r", "--report",
@@ -26,8 +25,8 @@ HOME = os.environ['HOME'] + "/"
 VM_BOOT_TIMEOUT = 180
 INSTANCE_NAME = "client"
 FLAVOR = "m1.small"
-IMAGE_NAME = "sf_summit2016"
-IMAGE_FILENAME = "sf_summit2016.qcow2"
+IMAGE_NAME = "sf_nsh_colorado"
+IMAGE_FILENAME = "sf_nsh_colorado.qcow2"
 IMAGE_FORMAT = "qcow2"
 IMAGE_PATH = "/home/opnfv/functest/data" + "/" + IMAGE_FILENAME
 
@@ -92,7 +91,7 @@ def main():
     if not os.path.isfile(IMAGE_PATH):
         logger.info("Downloading image")
         ft_utils.download_url(
-            "http://artifacts.opnfv.org/sfc/demo/sf_summit2016.qcow2",
+            "http://artifacts.opnfv.org/sfc/demo/sf_nsh_colorado.qcow2",
             "/home/opnfv/functest/data/")
     else:
         logger.info("Using old image")
@@ -247,7 +246,7 @@ def main():
         ssh.connect(ips[0], username="root",
                     password="opnfv", timeout=2)
         command = ("nohup python vxlan_tool.py -i eth0 "
-                   "-d forward -v off -f -b 80 &")
+                   "-d forward -v off -b 80 > /dev/null 2>&1 &")
         (stdin, stdout, stderr) = ssh.exec_command(command)
     except:
         logger.debug("Waiting for %s..." % ips[0])
@@ -271,7 +270,7 @@ def main():
         ssh.connect(ips[1], username="root",
                     password="opnfv", timeout=2)
         command = ("nohup python vxlan_tool.py -i eth0 "
-                   "-d forward -v off -f -b 22 &")
+                   "-d forward -v off -b 22 > /dev/null 2>&1 &")
         (stdin, stdout, stderr) = ssh.exec_command(command)
     except:
         logger.debug("Waiting for %s..." % ips[1])
@@ -350,6 +349,18 @@ def main():
         TACKER_CHANGECLASSI
     subprocess.call(tacker_classi, shell=True)
 
+    logger.info("Wait for ODL to update the classification rules in OVS")
+    time.sleep(10)
+
+    # SSH to modify the classification flows in compute
+
+    contr_cmd4 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2"
+                  " 'ssh " + ip_compute + " 'bash correct_classifier.bash''")
+    logger.info("Executing script to modify the classi: '%s'" % contr_cmd4)
+    process = subprocess.Popen(contr_cmd4,
+                               shell=True,
+                               stdout=subprocess.PIPE)
+
     # SSH TO EXECUTE cmd_client
 
     try: