diff options
Diffstat (limited to 'functest/tests/unit/openstack')
-rw-r--r-- | functest/tests/unit/openstack/rally/test_rally.py | 5 | ||||
-rw-r--r-- | functest/tests/unit/openstack/vping/test_vping.py | 40 |
2 files changed, 23 insertions, 22 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index 83f0c86a..450eb85b 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -260,13 +260,10 @@ class OSRallyTesting(unittest.TestCase): return_value=True) @mock.patch('functest.opnfv_tests.openstack.rally.rally.subprocess.Popen') @mock.patch('functest.opnfv_tests.openstack.rally.rally.os.makedirs') - @mock.patch('functest.opnfv_tests.openstack.rally.rally.os.popen') @mock.patch('functest.opnfv_tests.openstack.rally.rally.LOGGER.info') @mock.patch('functest.opnfv_tests.openstack.rally.rally.LOGGER.error') def test_run_task_default(self, mock_logger_error, mock_logger_info, - mock_popen, *args): - attrs = {'read.return_value': 'json_result'} - mock_popen.return_value.configure_mock(**attrs) + *args): self.rally_base._run_task('test_name') text = 'Test scenario: "test_name" OK.\n' mock_logger_info.assert_any_call(text) diff --git a/functest/tests/unit/openstack/vping/test_vping.py b/functest/tests/unit/openstack/vping/test_vping.py index a28c61ae..dbfb679f 100644 --- a/functest/tests/unit/openstack/vping/test_vping.py +++ b/functest/tests/unit/openstack/vping/test_vping.py @@ -10,15 +10,19 @@ import unittest import mock +from snaps.config.keypair import KeypairConfig +from snaps.config.network import NetworkConfig, PortConfig, SubnetConfig +from snaps.config.router import RouterConfig +from snaps.config.security_group import SecurityGroupConfig +from snaps.config.vm_inst import VmInstanceConfig + from snaps.openstack.create_image import OpenStackImage -from snaps.openstack.create_instance import OpenStackVmInstance, \ - VmInstanceSettings -from snaps.openstack.create_keypairs import OpenStackKeypair, KeypairSettings -from snaps.openstack.create_network import OpenStackNetwork, NetworkSettings, \ - SubnetSettings, PortSettings -from snaps.openstack.create_router import OpenStackRouter, RouterSettings -from snaps.openstack.create_security_group import OpenStackSecurityGroup, \ - SecurityGroupSettings +from snaps.openstack.create_instance import OpenStackVmInstance +from snaps.openstack.create_keypairs import OpenStackKeypair +from snaps.openstack.create_network import OpenStackNetwork +from snaps.openstack.create_router import OpenStackRouter +from snaps.openstack.create_security_group import OpenStackSecurityGroup + from snaps.openstack.os_credentials import OSCreds from functest.core.testcase import TestCase @@ -54,14 +58,14 @@ class VPingUserdataTesting(unittest.TestCase): return_value=OpenStackImage(self.os_creds, None)), \ mock.patch('snaps.openstack.utils.deploy_utils.create_network', return_value=OpenStackNetwork( - self.os_creds, NetworkSettings(name='foo'))), \ + self.os_creds, NetworkConfig(name='foo'))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_vm_instance', return_value=OpenStackVmInstance( self.os_creds, - VmInstanceSettings( + VmInstanceConfig( name='foo', flavor='bar', - port_settings=[PortSettings( + port_settings=[PortConfig( name='foo', network_name='bar')]), None)), \ mock.patch('snaps.openstack.create_instance.' @@ -120,32 +124,32 @@ class VPingSSHTesting(unittest.TestCase): mock.patch('snaps.openstack.utils.deploy_utils.create_network', return_value=OpenStackNetwork( self.os_creds, - NetworkSettings( + NetworkConfig( name='foo', subnet_settings=[ - SubnetSettings( + SubnetConfig( name='bar', cidr='10.0.0.1/24')]))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_vm_instance', return_value=OpenStackVmInstance( self.os_creds, - VmInstanceSettings( + VmInstanceConfig( name='foo', flavor='bar', - port_settings=[PortSettings( + port_settings=[PortConfig( name='foo', network_name='bar')]), None)), \ mock.patch('snaps.openstack.utils.deploy_utils.create_keypair', return_value=OpenStackKeypair( - self.os_creds, KeypairSettings(name='foo'))), \ + self.os_creds, KeypairConfig(name='foo'))), \ mock.patch('snaps.openstack.utils.deploy_utils.create_router', return_value=OpenStackRouter( - self.os_creds, RouterSettings(name='foo'))), \ + self.os_creds, RouterConfig(name='foo'))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_security_group', return_value=OpenStackSecurityGroup( self.os_creds, - SecurityGroupSettings(name='foo'))), \ + SecurityGroupConfig(name='foo'))), \ mock.patch('snaps.openstack.create_instance.' 'OpenStackVmInstance.' 'get_vm_inst', return_value=os_vm_inst), \ |