Revision 411e5025
b/snf-cyclades-app/synnefo/api/tests/subnets.py | ||
---|---|---|
91 | 91 |
response = self.post(SUBNETS_URL, test_net.userid, |
92 | 92 |
json.dumps(request), "json") |
93 | 93 |
self.assertSuccess(response) |
94 |
resp = json.loads(response.content)['subnet'] |
|
95 |
self.assertEqual("10.0.3.1", resp['gateway_ip']) |
|
96 |
self.assertEqual([{"start": "10.0.3.2", "end": "10.0.3.254"}], |
|
97 |
resp['allocation_pools']) |
|
98 |
self.assertEqual(True, resp['enable_dhcp']) |
|
94 | 99 |
|
95 | 100 |
def test_create_subnet_success_ipv4_with_slac(self): |
96 | 101 |
"""Test create an IPv4 subnet, with a slac that will be ingored""" |
... | ... | |
119 | 124 |
response = self.post(SUBNETS_URL, test_net.userid, |
120 | 125 |
json.dumps(request), "json") |
121 | 126 |
self.assertSuccess(response) |
127 |
resp = json.loads(response.content)['subnet'] |
|
128 |
self.assertEqual("fdc1:4992:1130:fc0b::1", resp['gateway_ip']) |
|
129 |
self.assertEqual([], resp['allocation_pools']) |
|
130 |
self.assertEqual(False, resp['enable_slac']) |
|
122 | 131 |
|
123 | 132 |
def test_create_subnet_with_malformed_slac(self): |
124 | 133 |
"""Test create a subnet with ipv6 and a malformed slac""" |
... | ... | |
182 | 191 |
response = self.post(SUBNETS_URL, test_net.userid, |
183 | 192 |
json.dumps(request), "json") |
184 | 193 |
self.assertSuccess(response) |
194 |
resp = json.loads(response.content)['subnet'] |
|
195 |
self.assertEqual([{"start": "10.0.3.2", "end": "10.0.3.100"}, |
|
196 |
{"start": "10.0.3.200", "end": "10.0.3.220"}], |
|
197 |
resp['allocation_pools']) |
|
185 | 198 |
|
186 | 199 |
def test_create_subnet_with_gateway_inside_of_ip_pool_range(self): |
187 | 200 |
"""Test create a subnet with an IP pool outside of network range""" |
... | ... | |
367 | 380 |
response = self.post(SUBNETS_URL, test_net.userid, json.dumps(request), |
368 | 381 |
"json") |
369 | 382 |
self.assertSuccess(response) |
383 |
resp = json.loads(response.content)['subnet'] |
|
384 |
self.assertEqual(["8.8.8.8", "1.1.1.1"], resp["host_routes"]) |
|
370 | 385 |
|
371 | 386 |
def test_create_subnet_with_same_ipversion(self): |
372 | 387 |
""" |
Also available in: Unified diff