aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2018-08-24 10:41:49 +0300
committerJuha Kosonen <juha.kosonen@nokia.com>2018-08-24 14:12:44 +0300
commit5d9acb84f492dca4da863c60e30a5463fe165cb5 (patch)
tree32dfab27ae776b39dc1b96aa96fd7ded3c0cdda8 /functest/tests
parent1da4b519f8e73d3be9e37f9d72367654bf662e63 (diff)
Create new project/user for snaps tests
JIRA: FUNCTEST-1003 Change-Id: Ic55998977386f95f619a355d22bd285782fe81f0 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/tests')
-rw-r--r--functest/tests/unit/openstack/snaps/test_snaps.py42
1 files changed, 30 insertions, 12 deletions
diff --git a/functest/tests/unit/openstack/snaps/test_snaps.py b/functest/tests/unit/openstack/snaps/test_snaps.py
index a3760445f..14bc38596 100644
--- a/functest/tests/unit/openstack/snaps/test_snaps.py
+++ b/functest/tests/unit/openstack/snaps/test_snaps.py
@@ -22,7 +22,7 @@ from functest.opnfv_tests.openstack.snaps import smoke
class APICheckTesting(unittest.TestCase):
"""
- Ensures the VPingUserdata class can run in Functest. This test does not
+ Ensures the ApiCheck class can run in Functest. This test does not
actually connect with an OpenStack pod.
"""
@@ -30,9 +30,15 @@ class APICheckTesting(unittest.TestCase):
self.os_creds = OSCreds(
username='user', password='pass',
auth_url='http://foo.com:5000/v3', project_name='bar')
-
- self.api_check = api_check.ApiCheck(
- os_creds=self.os_creds, ext_net_name='foo')
+ with mock.patch('os_client_config.get_config') as mock_get_config, \
+ mock.patch('shade.OpenStackCloud') as mock_shade, \
+ mock.patch('functest.core.tenantnetwork.NewProject') \
+ as mock_new_project:
+ self.api_check = api_check.ApiCheck(
+ os_creds=self.os_creds, ext_net_name='foo')
+ mock_get_config.assert_called()
+ mock_shade.assert_called()
+ mock_new_project.assert_called()
@mock.patch('functest.opnfv_tests.openstack.snaps.snaps_suite_builder.'
'add_openstack_client_tests')
@@ -93,7 +99,7 @@ class APICheckTesting(unittest.TestCase):
class HealthCheckTesting(unittest.TestCase):
"""
- Ensures the VPingUserdata class can run in Functest. This test does not
+ Ensures the HealthCheck class can run in Functest. This test does not
actually connect with an OpenStack pod.
"""
@@ -101,9 +107,15 @@ class HealthCheckTesting(unittest.TestCase):
self.os_creds = OSCreds(
username='user', password='pass',
auth_url='http://foo.com:5000/v3', project_name='bar')
-
- self.health_check = health_check.HealthCheck(
- os_creds=self.os_creds, ext_net_name='foo')
+ with mock.patch('os_client_config.get_config') as mock_get_config, \
+ mock.patch('shade.OpenStackCloud') as mock_shade, \
+ mock.patch('functest.core.tenantnetwork.NewProject') \
+ as mock_new_project:
+ self.health_check = health_check.HealthCheck(
+ os_creds=self.os_creds, ext_net_name='foo')
+ mock_get_config.assert_called()
+ mock_shade.assert_called()
+ mock_new_project.assert_called()
@mock.patch('snaps.openstack.tests.os_source_file_test.'
'OSIntegrationTestCase.parameterize')
@@ -161,7 +173,7 @@ class HealthCheckTesting(unittest.TestCase):
class SmokeTesting(unittest.TestCase):
"""
- Ensures the VPingUserdata class can run in Functest. This test does not
+ Ensures the SnapsSmoke class can run in Functest. This test does not
actually connect with an OpenStack pod.
"""
@@ -169,9 +181,15 @@ class SmokeTesting(unittest.TestCase):
self.os_creds = OSCreds(
username='user', password='pass',
auth_url='http://foo.com:5000/v3', project_name='bar')
-
- self.smoke = smoke.SnapsSmoke(
- os_creds=self.os_creds, ext_net_name='foo')
+ with mock.patch('os_client_config.get_config') as mock_get_config, \
+ mock.patch('shade.OpenStackCloud') as mock_shade, \
+ mock.patch('functest.core.tenantnetwork.NewProject') \
+ as mock_new_project:
+ self.smoke = smoke.SnapsSmoke(
+ os_creds=self.os_creds, ext_net_name='foo')
+ mock_get_config.assert_called()
+ mock_shade.assert_called()
+ mock_new_project.assert_called()
@mock.patch('functest.opnfv_tests.openstack.snaps.snaps_suite_builder.'
'add_openstack_integration_tests')