diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-11-20 14:56:44 -0700 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-11-21 09:31:20 -0700 |
commit | 0e377731a20617c9cdb886a597395c61ae490e38 (patch) | |
tree | ae58c1cf1cabbfcbcc0b483d62be31926a24f0e2 /snaps/openstack/utils/tests/neutron_utils_tests.py | |
parent | 594e4d2b15dcf59fc7dc1b8380b096382a0b1cb1 (diff) |
Refactoring of SecurityGroupSettings to extend SecurityGroupConfig
SecurityGroupSettings, SecurityGroupSettings and neutron_utils have a
runtime cyclical dependency. This patch reduces this dependency and
deprecates the SecurityGroupSettings and SecurityGroupRuleSettings class with
snaps.config.security_group SecurityGroupConfig and SecurityGroupRuleConfg classes
JIRA: SNAPS-224
Change-Id: I6cd82ed5be31f4a24449be767b203e86489b1962
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/neutron_utils_tests.py')
-rw-r--r-- | snaps/openstack/utils/tests/neutron_utils_tests.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/snaps/openstack/utils/tests/neutron_utils_tests.py b/snaps/openstack/utils/tests/neutron_utils_tests.py index 44bc59f..38faf71 100644 --- a/snaps/openstack/utils/tests/neutron_utils_tests.py +++ b/snaps/openstack/utils/tests/neutron_utils_tests.py @@ -17,8 +17,8 @@ import uuid from neutronclient.common.exceptions import NotFound, BadRequest from snaps.config.network import NetworkConfig, SubnetConfig, PortConfig -from snaps.openstack.create_security_group import ( - SecurityGroupSettings, SecurityGroupRuleSettings, Direction) +from snaps.config.security_group import ( + SecurityGroupConfig, SecurityGroupRuleConfig, Direction) from snaps.openstack.tests import openstack_tests from snaps.openstack.tests import validation_utils from snaps.openstack.tests.os_source_file_test import OSComponentTestCase @@ -841,7 +841,7 @@ class NeutronUtilsSecurityGroupTests(OSComponentTestCase): """ Tests the neutron_utils.create_security_group() function """ - sec_grp_settings = SecurityGroupSettings(name=self.sec_grp_name) + sec_grp_settings = SecurityGroupConfig(name=self.sec_grp_name) security_group = neutron_utils.create_security_group(self.neutron, self.keystone, sec_grp_settings) @@ -861,13 +861,13 @@ class NeutronUtilsSecurityGroupTests(OSComponentTestCase): def test_create_sec_grp_no_name(self): """ - Tests the SecurityGroupSettings constructor and + Tests the SecurityGroupConfig constructor and neutron_utils.create_security_group() function to ensure that attempting to create a security group without a name will raise an exception """ with self.assertRaises(Exception): - sec_grp_settings = SecurityGroupSettings() + sec_grp_settings = SecurityGroupConfig() self.security_groups.append( neutron_utils.create_security_group(self.neutron, self.keystone, @@ -877,8 +877,8 @@ class NeutronUtilsSecurityGroupTests(OSComponentTestCase): """ Tests the neutron_utils.create_security_group() function """ - sec_grp_settings = SecurityGroupSettings(name=self.sec_grp_name, - description='hello group') + sec_grp_settings = SecurityGroupConfig( + name=self.sec_grp_name, description='hello group') self.security_groups.append( neutron_utils.create_security_group(self.neutron, self.keystone, sec_grp_settings)) @@ -896,9 +896,9 @@ class NeutronUtilsSecurityGroupTests(OSComponentTestCase): Tests the neutron_utils.create_security_group() function """ - sec_grp_rule_settings = SecurityGroupRuleSettings( + sec_grp_rule_settings = SecurityGroupRuleConfig( sec_grp_name=self.sec_grp_name, direction=Direction.ingress) - sec_grp_settings = SecurityGroupSettings( + sec_grp_settings = SecurityGroupConfig( name=self.sec_grp_name, description='hello group', rule_settings=[sec_grp_rule_settings]) @@ -939,12 +939,12 @@ class NeutronUtilsSecurityGroupTests(OSComponentTestCase): self.security_groups.append(neutron_utils.create_security_group( self.neutron, self.keystone, - SecurityGroupSettings(name=self.sec_grp_name + '-1', - description='hello group'))) + SecurityGroupConfig( + name=self.sec_grp_name + '-1', description='hello group'))) self.security_groups.append(neutron_utils.create_security_group( self.neutron, self.keystone, - SecurityGroupSettings(name=self.sec_grp_name + '-2', - description='hello group'))) + SecurityGroupConfig( + name=self.sec_grp_name + '-2', description='hello group'))) sec_grp_1b = neutron_utils.get_security_group_by_id( self.neutron, self.security_groups[0].id) |