Merge "Enable tempest offline by use_custom_images=True"
[functest.git] / functest / opnfv_tests / openstack / vping / vping_base.py
index 8eb41be..856d5f2 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Copyright (c) 2015 All rights reserved
 # This program and the accompanying materials
 #
 # Copyright (c) 2015 All rights reserved
 # This program and the accompanying materials
@@ -13,7 +13,7 @@ import os
 import time
 import uuid
 
 import time
 import uuid
 
-from functest.core.testcase import TestCase
+from functest.core import testcase
 from functest.utils import functest_utils
 from functest.utils.constants import CONST
 
 from functest.utils import functest_utils
 from functest.utils.constants import CONST
 
@@ -24,13 +24,14 @@ from snaps.openstack.tests import openstack_tests
 from snaps.openstack.utils import deploy_utils, nova_utils
 
 
 from snaps.openstack.utils import deploy_utils, nova_utils
 
 
-class VPingBase(TestCase):
+class VPingBase(testcase.OSGCTestCase):
 
     """
     Base class for vPing tests that check connectivity between two VMs shared
     internal network.
     This class is responsible for creating the image, internal network.
     """
 
     """
     Base class for vPing tests that check connectivity between two VMs shared
     internal network.
     This class is responsible for creating the image, internal network.
     """
+
     def __init__(self, **kwargs):
         super(VPingBase, self).__init__(**kwargs)
 
     def __init__(self, **kwargs):
         super(VPingBase, self).__init__(**kwargs)
 
@@ -78,7 +79,7 @@ class VPingBase(TestCase):
 
         scenario = functest_utils.get_scenario()
 
 
         scenario = functest_utils.get_scenario()
 
-        self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_ANY
+        self.flavor_metadata = None
         if 'ovs' in scenario or 'fdio' in scenario:
             self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
 
         if 'ovs' in scenario or 'fdio' in scenario:
             self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
 
@@ -151,12 +152,12 @@ class VPingBase(TestCase):
         else:
             raise Exception('VMs never became active')
 
         else:
             raise Exception('VMs never became active')
 
-        if result == TestCase.EX_RUN_ERROR:
-            return TestCase.EX_RUN_ERROR
+        if result == testcase.TestCase.EX_RUN_ERROR:
+            return testcase.TestCase.EX_RUN_ERROR
 
         self.stop_time = time.time()
 
         self.stop_time = time.time()
-        self.result = 'PASS'
-        return TestCase.EX_OK
+        self.result = 100
+        return testcase.TestCase.EX_OK
 
     def _cleanup(self):
         """
 
     def _cleanup(self):
         """
@@ -193,6 +194,7 @@ class VPingBase(TestCase):
 
 
 class VPingMain(object):
 
 
 class VPingMain(object):
+
     def __init__(self, vping_cls):
         self.vping = vping_cls()
 
     def __init__(self, vping_cls):
         self.vping = vping_cls()