aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/tests/TestFunctestUtils.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-01-14 11:45:19 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-14 15:01:23 +0000
commit2f3d438bd74f39deaca80cd8adbc9a636ccb3227 (patch)
treefb62a35e92d7618be1a8018d03eac527749926d7 /testcases/tests/TestFunctestUtils.py
parentc8e55f0a6ff26cbf179ef518713b1fe104ff8a05 (diff)
set up mechanism to tun only runnable tests in CI based on scenario
JIRA: FUNCTEST-119 Change-Id: I342c027c79fab1cc9fa65ddf8222e7b12b946af8 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com> (cherry picked from commit cdf5e6a2fd05f07a5db92175777113d732258a94)
Diffstat (limited to 'testcases/tests/TestFunctestUtils.py')
-rw-r--r--testcases/tests/TestFunctestUtils.py41
1 files changed, 15 insertions, 26 deletions
diff --git a/testcases/tests/TestFunctestUtils.py b/testcases/tests/TestFunctestUtils.py
index 46da50cb8..6f12e603d 100644
--- a/testcases/tests/TestFunctestUtils.py
+++ b/testcases/tests/TestFunctestUtils.py
@@ -11,25 +11,24 @@ class TestFunctestUtils(unittest.TestCase):
def setUp(self):
os.environ["INSTALLER_TYPE"] = "fuel"
- os.environ["SDN_CONTROLLER"] = "odl"
- os.environ["OPNFV_FEATURE"] = "ovs2.4"
+ os.environ["DEPLOY_SCENARIO"] = "os-odl_l3-ovs-ha"
global functest_yaml
- with open("/home/opnfv/functest/conf/config_functest.yaml") as f:
+ with open("../config_functest.yaml") as f:
functest_yaml = yaml.safe_load(f)
f.close()
def test_getTestEnv(self):
env_test = getTestEnv('ovno', functest_yaml)
- self.assertEqual(env_test, {'controller': 'opencontrail'})
+ self.assertEqual(env_test, {'scenario': 'ocl'})
env_test = getTestEnv('doctor', functest_yaml)
- self.assertEqual(env_test, None)
+ self.assertEqual(env_test, {'installer': 'fuel'})
env_test = getTestEnv('promise', functest_yaml)
- self.assertEqual(env_test, None)
+ self.assertEqual(env_test, {'installer': '(fuel)|(joid)'})
env_test = getTestEnv('functest/tempest', functest_yaml)
self.assertEqual(env_test, None)
@@ -38,30 +37,22 @@ class TestFunctestUtils(unittest.TestCase):
self.assertEqual(env_test, None)
env_test = getTestEnv('functest/odl', functest_yaml)
- self.assertEqual(env_test, {'controller': 'odl'})
+ self.assertEqual(env_test, {'scenario': 'odl'})
env_test = getTestEnv('functest/onos', functest_yaml)
- self.assertEqual(env_test, {'controller': 'onos'})
-
- env_test = getTestEnv('functest/onos-ovsdb', functest_yaml)
- self.assertEqual(env_test, {'controller': 'onos'})
+ self.assertEqual(env_test, {'scenario': 'onos'})
env_test = getTestEnv('policy-test', functest_yaml)
- self.assertEqual(env_test, {'controller': 'odl'})
+ self.assertEqual(env_test, {'scenario': 'odl'})
env_test = getTestEnv('sdnvpn/odl-vpn_service-tests', functest_yaml)
self.assertEqual(env_test,
- {'controller': 'odl', 'scenario': 'os_ovh_ha'})
+ {'installer': 'fuel', 'scenario': '(ovs)*(odl)'})
env_test = getTestEnv('sdnvpn/opnfv-yardstick-tc026-sdnvpn',
functest_yaml)
self.assertEqual(env_test,
- {'controller': 'nosdn', 'scenario': 'os_ovh_ha'})
-
- env_test = getTestEnv('sdnvpn/openstack-neutron-bgpvpn-api-extension-tests',
- functest_yaml)
- self.assertEqual(env_test,
- {'controller': 'nosdn', 'scenario': 'os_ovh_ha'})
+ {'installer': 'fuel', 'scenario': '(ovs)*(nosdn)'})
env_test = getTestEnv('foo', functest_yaml)
self.assertEqual(env_test, '')
@@ -106,17 +97,15 @@ class TestFunctestUtils(unittest.TestCase):
def test_generateTestcaseList(self):
test = generateTestcaseList(functest_yaml)
- test = sorted(test.split(' '))
- expected_list = "doctor vims odl rally vping tempest promise policy-test odl-vpn_service-tests "
- expected_list_array = sorted(expected_list.split(' '))
-
- self.assertEqual(test, expected_list_array)
+
+ expected_list = "vping tempest odl doctor promise policy-test odl-vpn_service-tests vims rally "
+ self.assertEqual(test, expected_list)
def tearDown(self):
os.environ["INSTALLER_TYPE"] = ""
- os.environ["SDN_CONTROLLER"] = ""
- os.environ["OPNFV_FEATURE"] = ""
+ os.environ["DEPLOY_SCENARIO"] = ""
if __name__ == '__main__':
unittest.main()
+