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
9b56728c
Commit
9b56728c
authored
Nov 12, 2013
by
Christos Stavrakakis
Browse files
cyclades: Fix some broking tests
parent
0e97cb82
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/tests/floating_ips.py
View file @
9b56728c
...
...
@@ -33,7 +33,7 @@
from
django.utils
import
simplejson
as
json
from
snf_django.utils.testing
import
BaseAPITest
,
mocked_quotaholder
from
synnefo.db.models
import
IPAddress
,
Network
from
synnefo.db.models
import
IPAddress
,
Network
,
Subnet
,
IPPoolTable
from
synnefo.db
import
models_factory
as
mf
from
mock
import
patch
,
Mock
...
...
@@ -127,6 +127,8 @@ class FloatingIPAPITest(BaseAPITest):
"""Test reserve FIP without specifying network."""
request
=
{
"floatingip"
:
{}}
# delete all pools..
IPPoolTable
.
objects
.
all
().
delete
()
Subnet
.
objects
.
all
().
delete
()
Network
.
objects
.
all
().
delete
()
# CASE: no floating IP pool
with
mocked_quotaholder
():
...
...
snf-cyclades-app/synnefo/logic/tests/reconciliation.py
View file @
9b56728c
...
...
@@ -244,28 +244,7 @@ class NetworkReconciliationTest(TestCase):
"external_reservations"
:
""
}]
self
.
reconciler
.
reconcile_networks
()
self
.
assertTrue
(
net1
.
backend_networks
.
filter
(
backend
=
self
.
backend
).
exists
())
# ..but not if it is destroying
net1
.
backend_networks
.
all
().
delete
()
net1
.
action
=
"DESTROY"
net1
.
save
()
self
.
reconciler
.
reconcile_networks
()
self
.
assertFalse
(
net1
.
backend_networks
.
filter
(
backend
=
self
.
backend
).
exists
())
# or network is public!
net1
.
action
=
"CREATE"
net1
.
public
=
True
net1
.
save
()
self
.
reconciler
.
reconcile_networks
()
self
.
assertFalse
(
net1
.
backend_networks
.
filter
(
backend
=
self
.
backend
).
exists
())
# Test creation if network is a floating IP pool
net2
=
mfactory
.
NetworkWithSubnetFactory
(
floating_ip_pool
=
True
)
mrapi
().
GetNetworks
.
return_value
=
[]
self
.
assertEqual
(
net2
.
backend_networks
.
count
(),
0
)
self
.
reconciler
.
reconcile_networks
()
self
.
assertTrue
(
net2
.
backend_networks
.
filter
(
backend
=
self
.
backend
).
exists
())
.
filter
(
backend
=
self
.
backend
).
exists
())
def
test_stale_network
(
self
,
mrapi
):
# Test that stale network will be deleted from DB, if network action is
...
...
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