Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
router_services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nova
router_services
Commits
502b906b
Commit
502b906b
authored
Jun 13, 2014
by
Sigmund Augdal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for any source with protocol ip
parent
0c81aa5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
nova_router/tests/test_iptablesconf.py
nova_router/tests/test_iptablesconf.py
+21
-0
No files found.
nova_router/tests/test_iptablesconf.py
View file @
502b906b
...
...
@@ -88,6 +88,27 @@ class TestProcessSecurityGroup(object):
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'
)
@
mock
.
patch
(
'nova_router.security_groups.get_group_rules'
)
def
test_ip_protocol_from_any
(
self
,
get_group_rules
,
get_group_mode
,
get_group_members
):
get_group_members
.
return_value
=
[
'00:11:22:33:44:55'
,
[
'00:11:22:33:44:55'
]]
get_group_mode
.
return_value
=
"closed"
get_group_rules
.
return_value
=
[
{
'id'
:
1
,
'protocol'
:
'ip'
,
'source_type'
:
'any'
,
},
]
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'
,
'ip'
,
None
)
self
.
generator
.
add_ipset_member_family
.
assert_any_call
(
iptables_configurator
.
RULES_FROM_ANY_TO_IP
,
'00:11:22:33:44:55'
,
'inet6'
,
''
,
None
,
self
.
generator
.
addresses_v6
)
self
.
generator
.
add_ipset_member_family
.
assert_any_call
(
iptables_configurator
.
RULES_FROM_ANY_TO_IP
,
'00:11:22:33:44:55'
,
'inet'
,
''
,
None
,
self
.
generator
.
addresses_v4
)
@
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_rules'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment