aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
diff options
context:
space:
mode:
Diffstat (limited to 'functest/tests')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py8
-rw-r--r--functest/tests/unit/openstack/refstack_client/test_refstack_client.py22
-rw-r--r--functest/tests/unit/utils/test_openstack_utils.py53
3 files changed, 4 insertions, 79 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index b9e78616..8845f660 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -53,14 +53,6 @@ class OSRallyTesting(unittest.TestCase):
task_args = self.rally_base._build_task_args('test_file_name')
self.assertEqual(task_args['netid'], '')
- def test_build_task_args_missing_auth_url(self):
- CONST.__setattr__('OS_AUTH_URL', None)
- with mock.patch('functest.opnfv_tests.openstack.rally.rally.'
- 'os_utils.get_external_net',
- return_value='test_floating_network'):
- task_args = self.rally_base._build_task_args('test_file_name')
- self.assertEqual(task_args['request_url'], '')
-
def check_scenario_file(self, value):
yaml_file = 'opnfv-{}.yaml'.format('test_file_name')
if yaml_file in value:
diff --git a/functest/tests/unit/openstack/refstack_client/test_refstack_client.py b/functest/tests/unit/openstack/refstack_client/test_refstack_client.py
index 3a121245..f92d2806 100644
--- a/functest/tests/unit/openstack/refstack_client/test_refstack_client.py
+++ b/functest/tests/unit/openstack/refstack_client/test_refstack_client.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+# matthew.lijun@huawei.com wangwulin@huawei.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
@@ -12,7 +13,6 @@ import unittest
from functest.core import testcase
from functest.opnfv_tests.openstack.refstack_client import refstack_client
-from functest.utils.constants import CONST
class OSRefstackClientTesting(unittest.TestCase):
@@ -28,27 +28,13 @@ class OSRefstackClientTesting(unittest.TestCase):
'testlist': self._testlist}
self.refstackclient = refstack_client.RefstackClient()
- def test_source_venv(self):
- with mock.patch('functest.opnfv_tests.openstack.refstack_client.'
- 'refstack_client.ft_utils.execute_command') as m:
- cmd = ("cd {0};"
- ". .venv/bin/activate;"
- "cd -;"
- .format(CONST.__getattribute__('dir_refstack_client')))
- self.refstackclient.source_venv()
- m.assert_any_call(cmd)
-
def test_run_defcore(self):
config = 'tempest.conf'
testlist = 'testlist'
with mock.patch('functest.opnfv_tests.openstack.refstack_client.'
'refstack_client.ft_utils.execute_command') as m:
- cmd = ("cd {0};"
- "./refstack-client test -c {1} -v --test-list {2};"
- "cd -;"
- .format(CONST.__getattribute__('dir_refstack_client'),
- config,
- testlist))
+ cmd = ("refstack-client test -c {0} -v --test-list {1}"
+ .format(config, testlist))
self.refstackclient.run_defcore(config, testlist)
m.assert_any_call(cmd)
diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py
index 74b49aaa..828fb3d4 100644
--- a/functest/tests/unit/utils/test_openstack_utils.py
+++ b/functest/tests/unit/utils/test_openstack_utils.py
@@ -255,12 +255,6 @@ class OSUtilsTesting(unittest.TestCase):
'delete_port.return_value': mock.Mock(),
'remove_interface_router.return_value': mock.Mock(),
'remove_gateway_router.return_value': mock.Mock(),
- 'create_bgpvpn.return_value': self.mock_return,
- 'create_network_association.return_value': self.mock_return,
- 'create_router_association.return_value': self.mock_return,
- 'update_bgpvpn.return_value': self.mock_return,
- 'delete_bgpvpn.return_value': self.mock_return,
- 'show_bgpvpn.return_value': self.mock_return,
'list_security_groups.return_value': {'security_groups':
[self.sec_group]},
'list_security_group_rules.'
@@ -1212,53 +1206,6 @@ class OSUtilsTesting(unittest.TestCase):
'router_id'))
self.assertTrue(mock_logger_error.called)
- def test_create_bgpvpn(self):
- self.assertEqual(openstack_utils.
- create_bgpvpn(self.neutron_client),
- self.mock_return)
-
- def test_create_network_association(self):
- self.assertEqual(openstack_utils.
- create_network_association(self.neutron_client,
- 'bgpvpn_id',
- 'network_id'),
- self.mock_return)
-
- def test_create_router_association(self):
- self.assertEqual(openstack_utils.
- create_router_association(self.neutron_client,
- 'bgpvpn_id',
- 'router_id'),
- self.mock_return)
-
- def test_update_bgpvpn(self):
- self.assertEqual(openstack_utils.
- update_bgpvpn(self.neutron_client,
- 'bgpvpn_id'),
- self.mock_return)
-
- def test_delete_bgpvpn(self):
- self.assertEqual(openstack_utils.
- delete_bgpvpn(self.neutron_client,
- 'bgpvpn_id'),
- self.mock_return)
-
- def test_get_bgpvpn(self):
- self.assertEqual(openstack_utils.
- get_bgpvpn(self.neutron_client,
- 'bgpvpn_id'),
- self.mock_return)
-
- def test_get_bgpvpn_routers(self):
- with mock.patch('functest.utils.openstack_utils.'
- 'get_bgpvpn',
- return_value={'bgpvpn':
- {'routers': [self.router]}}):
- self.assertEqual(openstack_utils.
- get_bgpvpn_routers(self.neutron_client,
- 'bgpvpn_id'),
- [self.router])
-
def test_get_security_groups_default(self):
self.assertEqual(openstack_utils.
get_security_groups(self.neutron_client),