Merge "Add own logger for SdnvpnFuncTest class"
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Thu, 7 Jun 2018 14:29:24 +0000 (14:29 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 7 Jun 2018 14:29:24 +0000 (14:29 +0000)
sdnvpn/lib/config.py
sdnvpn/test/functest/testcase_13.py
sdnvpn/test/functest/testcase_3.py

index 81d895b..847b41c 100644 (file)
@@ -53,7 +53,7 @@ class CommonConfig(object):
             # TODO does functest have an ubuntu image somewhere?
             self.ubuntu_image_name = "sdnvpn-ubuntu"
             self.ubuntu_image_path = '{0}/{1}'.format(
-                getattr(config.CONF, 'dir_functest_images'),
+                getattr(config.CONF, 'dir_functest_data'),
                 "ubuntu-16.04-server-cloudimg-amd64-disk1.img")
             self.custom_flavor_name = 'm1.custom'
             self.custom_flavor_ram = 1024
index 35a1a31..8beb1db 100644 (file)
@@ -9,6 +9,7 @@
 #
 
 import logging
+import os
 import sys
 
 from random import randint
@@ -31,6 +32,17 @@ def main():
     results.add_to_summary(2, "STATUS", "SUBTEST")
     results.add_to_summary(0, "=")
 
+    if not os.path.isfile(COMMON_CONFIG.ubuntu_image_path):
+        logger.info("Downloading image")
+        image_dest_path = '/'.join(
+                COMMON_CONFIG.ubuntu_image_path.split('/')[:-1])
+        os_utils.download_url(
+            "http://artifacts.opnfv.org/sdnvpn/"
+            "ubuntu-16.04-server-cloudimg-amd64-disk1.img",
+            image_dest_path)
+    else:
+        logger.info("Using old image")
+
     nova_client = os_utils.get_nova_client()
     neutron_client = os_utils.get_neutron_client()
     glance_client = os_utils.get_glance_client()
index 373e5a8..95023c6 100644 (file)
@@ -140,10 +140,12 @@ def main():
     # Taken from the sfc tests
     if not os.path.isfile(COMMON_CONFIG.ubuntu_image_path):
         logger.info("Downloading image")
+        image_dest_path = '/'.join(
+                COMMON_CONFIG.ubuntu_image_path.split('/')[:-1])
         os_utils.download_url(
             "http://artifacts.opnfv.org/sdnvpn/"
             "ubuntu-16.04-server-cloudimg-amd64-disk1.img",
-            "/home/opnfv/functest/data/")
+            image_dest_path)
     else:
         logger.info("Using old image")