Commit 0c81aa5b authored by Sigmund Augdal's avatar Sigmund Augdal

Added more detail to the from_any check

parent abe505bf
......@@ -18,6 +18,7 @@ class TestProcessSecurityGroup(object):
self.generator.create_ipset = mock.MagicMock(wraps=self.generator.create_ipset)
self.generator.add_ipset_net = mock.MagicMock(wraps=self.generator.add_ipset_net)
self.generator.add_ipset_member = mock.MagicMock(wraps=self.generator.add_ipset_member)
self.generator.add_ipset_member_family = mock.MagicMock(wraps=self.generator.add_ipset_member_family)
@mock.patch('nova_router.security_groups.get_group_members')
@mock.patch('nova_router.security_groups.get_group_mode')
......@@ -82,6 +83,10 @@ class TestProcessSecurityGroup(object):
self.generator.process_security_group("a", "b")
self.generator.add_ipset_member.assert_called_with(iptables_configurator.RULES_FROM_ANY,
'00:11:22:33:44:55', 'tcp', 22)
self.generator.add_ipset_member_family.assert_any_call(iptables_configurator.RULES_FROM_ANY,
'00:11:22:33:44:55', 'inet6', ',tcp:22', None, self.generator.addresses_v6)
self.generator.add_ipset_member_family.assert_any_call(iptables_configurator.RULES_FROM_ANY,
'00:11:22:33:44:55', 'inet', ',tcp:22', None, self.generator.addresses_v4)
@mock.patch('nova_router.security_groups.get_group_members')
@mock.patch('nova_router.security_groups.get_group_mode')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment