diff options
author | 2018-04-11 23:19:00 +0200 | |
---|---|---|
committer | 2018-04-12 00:15:55 +0200 | |
commit | a68cbbae1509d2e4c33cff8b6226cf6e83c58251 (patch) | |
tree | 098f2aee690469a0adddf0a81c430e71ca7a3da4 | |
parent | 390d31e3a6eaa0968474d19d71ec804d0c6c071a (diff) |
Fixing security group in CreateInstanceTwoNetTests
The test CreateInstanceTwoNetTests does define and create a security
group and a corresponding rule but never associates them with the
created instances. Moreover, some commercial systems require explicit
egress rules in addition to ingress rules in order to allow traffic to
pass. Anm egress rule has been added.
JIRA: SNAPS-300
Change-Id: Ie0da75781f8b4e97af11e4e7588c7a53acad59ac
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
-rw-r--r-- | snaps/openstack/tests/create_instance_tests.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/snaps/openstack/tests/create_instance_tests.py b/snaps/openstack/tests/create_instance_tests.py index c0e3195..ce58a01 100644 --- a/snaps/openstack/tests/create_instance_tests.py +++ b/snaps/openstack/tests/create_instance_tests.py @@ -2902,14 +2902,17 @@ class CreateInstanceTwoNetTests(OSIntegrationTestCase): metadata=self.flavor_metadata)) self.flavor_creator.create() - sec_grp_name = self.guid + '-sec-grp' + self.sec_grp_name = self.guid + '-sec-grp' rule1 = SecurityGroupRuleConfig( - sec_grp_name=sec_grp_name, direction=Direction.ingress, + sec_grp_name=self.sec_grp_name, direction=Direction.ingress, + protocol=Protocol.icmp) + rule2 = SecurityGroupRuleConfig( + sec_grp_name=self.sec_grp_name, direction=Direction.egress, protocol=Protocol.icmp) self.sec_grp_creator = OpenStackSecurityGroup( self.os_creds, SecurityGroupConfig( - name=sec_grp_name, rule_settings=[rule1])) + name=self.sec_grp_name, rule_settings=[rule1, rule2])) self.sec_grp_creator.create() except: self.tearDown() @@ -2989,6 +2992,7 @@ class CreateInstanceTwoNetTests(OSIntegrationTestCase): name=self.vm_inst1_name, flavor=self.flavor_creator.flavor_settings.name, userdata=_get_ping_userdata(self.ip2), + security_group_names=self.sec_grp_name, port_settings=[PortConfig( name=self.port_1_name, ip_addrs=[{ @@ -3001,6 +3005,7 @@ class CreateInstanceTwoNetTests(OSIntegrationTestCase): name=self.vm_inst2_name, flavor=self.flavor_creator.flavor_settings.name, userdata=_get_ping_userdata(self.ip1), + security_group_names=self.sec_grp_name, port_settings=[PortConfig( name=self.port_2_name, ip_addrs=[{ |