Commit 72266e9f authored by Sigmund Augdal's avatar Sigmund Augdal

Etcd values are stored as strings. Reflect this in the unit tests.

parent 27fdb8db
...@@ -58,12 +58,12 @@ class TestProcessSecurityGroup(object): ...@@ -58,12 +58,12 @@ class TestProcessSecurityGroup(object):
'protocol': 'tcp', 'protocol': 'tcp',
'source_type': 'cidr', 'source_type': 'cidr',
'source_cidr': '10.0.0.1/32', 'source_cidr': '10.0.0.1/32',
'destination_port': 22, 'destination_port': '22',
}, },
] ]
self.generator.process_security_group("a", "b") self.generator.process_security_group("a", "b")
self.generator.add_ipset_member.assert_called_with(iptables_configurator.RULES_FROM_CIDR, self.generator.add_ipset_member.assert_called_with(iptables_configurator.RULES_FROM_CIDR,
"00:11:22:33:44:55", "tcp", 22, "00:11:22:33:44:55", "tcp", '22',
"10.0.0.1/32") "10.0.0.1/32")
@mock.patch('nova_router.security_groups.get_group_members') @mock.patch('nova_router.security_groups.get_group_members')
...@@ -77,12 +77,12 @@ class TestProcessSecurityGroup(object): ...@@ -77,12 +77,12 @@ class TestProcessSecurityGroup(object):
'id': 1, 'id': 1,
'protocol': 'tcp', 'protocol': 'tcp',
'source_type': 'any', 'source_type': 'any',
'destination_port': 22, 'destination_port': '22',
}, },
] ]
self.generator.process_security_group("a", "b") self.generator.process_security_group("a", "b")
self.generator.add_ipset_member.assert_called_with(iptables_configurator.RULES_FROM_ANY, self.generator.add_ipset_member.assert_called_with(iptables_configurator.RULES_FROM_ANY,
'00:11:22:33:44:55', 'tcp', 22) '00:11:22:33:44:55', 'tcp', '22')
self.generator.add_ipset_member_family.assert_any_call(iptables_configurator.RULES_FROM_ANY, 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) '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, self.generator.add_ipset_member_family.assert_any_call(iptables_configurator.RULES_FROM_ANY,
...@@ -121,11 +121,11 @@ class TestProcessSecurityGroup(object): ...@@ -121,11 +121,11 @@ class TestProcessSecurityGroup(object):
'protocol': 'tcp', 'protocol': 'tcp',
'source_type': 'security_group', 'source_type': 'security_group',
'source_security_group': '1', 'source_security_group': '1',
'destination_port': 22, 'destination_port': '22',
}, },
] ]
self.generator.process_security_group("a", "b") self.generator.process_security_group("a", "b")
self.generator.add_ipset_member.assert_called_with('rls_by_src1', '00:11:22:33:44:55', 'tcp', 22) self.generator.add_ipset_member.assert_called_with('rls_by_src1', '00:11:22:33:44:55', 'tcp', '22')
@mock.patch('nova_router.security_groups.get_group_members') @mock.patch('nova_router.security_groups.get_group_members')
@mock.patch('nova_router.security_groups.get_group_mode') @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