Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
48c20061
Commit
48c20061
authored
Nov 04, 2013
by
Dionysis Grigoropoulos
Browse files
cyclades: Add a test for subnet creation
parent
228b7d1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/tests/subnets.py
View file @
48c20061
...
...
@@ -196,8 +196,27 @@ class SubnetTest(BaseAPITest):
{
"start"
:
"10.0.3.200"
,
"end"
:
"10.0.3.220"
}],
resp
[
'allocation_pools'
])
def
test_create_subnet_with_gateway
(
self
):
"""Test create a subnet with a gateway"""
test_net
=
mf
.
NetworkFactory
()
request
=
{
'subnet'
:
{
'network_id'
:
test_net
.
id
,
'cidr'
:
'10.0.3.0/24'
,
'ip_version'
:
4
,
'gateway_ip'
:
'10.0.3.150'
}
}
response
=
self
.
post
(
SUBNETS_URL
,
test_net
.
userid
,
json
.
dumps
(
request
),
"json"
)
self
.
assertSuccess
(
response
)
resp
=
json
.
loads
(
response
.
content
)[
'subnet'
]
self
.
assertEqual
(
"10.0.3.150"
,
resp
[
'gateway_ip'
])
self
.
assertEqual
([{
"start"
:
"10.0.3.1"
,
"end"
:
"10.0.3.149"
},
{
"start"
:
"10.0.3.151"
,
"end"
:
"10.0.3.254"
}],
resp
[
'allocation_pools'
])
def
test_create_subnet_with_gateway_inside_of_ip_pool_range
(
self
):
"""Test create a subnet with a
n IP pool outside of network
range"""
"""Test create a subnet with a
gateway IP inside the IP pool
range"""
test_net
=
mf
.
NetworkFactory
()
request
=
{
'subnet'
:
{
...
...
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