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
0a81db18
Commit
0a81db18
authored
Dec 18, 2013
by
Christos Stavrakakis
Browse files
cyclades: Comment out unused tests
Security groups are not working yet. Comment out relevant tests.
parent
4d65de55
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/floating_ips.py
View file @
0a81db18
...
...
@@ -97,7 +97,7 @@ def ip_to_dict(floating_ip):
"id"
:
str
(
floating_ip
.
id
),
"instance_id"
:
str
(
machine_id
)
if
machine_id
else
None
,
"floating_ip_address"
:
floating_ip
.
address
,
"port_id"
:
str
(
floating_ip
.
nic
.
id
)
if
port_id
else
None
,
"port_id"
:
str
(
port_
id
)
if
port_id
else
None
,
"floating_network_id"
:
str
(
floating_ip
.
network_id
)}
...
...
snf-cyclades-app/synnefo/api/tests/ports.py
View file @
0a81db18
...
...
@@ -91,31 +91,31 @@ class PortTest(BaseAPITest):
res
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
res
[
'port'
][
'name'
],
"test-name"
)
def
test_update_port_sg_unfound
(
self
):
sg1
=
dbmf
.
SecurityGroupFactory
()
nic
=
dbmf
.
NetworkInterfaceFactory
(
device_owner
=
'vm'
)
nic
.
security_groups
.
add
(
sg1
)
nic
.
save
()
url
=
join_urls
(
PORTS_URL
,
str
(
nic
.
id
))
request
=
{
'port'
:
{
"security_groups"
:
[
"123"
]}}
response
=
self
.
put
(
url
,
params
=
json
.
dumps
(
request
),
user
=
nic
.
userid
)
self
.
assertEqual
(
response
.
status_code
,
404
)
#
def test_update_port_sg_unfound(self):
#
sg1 = dbmf.SecurityGroupFactory()
#
nic = dbmf.NetworkInterfaceFactory(device_owner='vm')
#
nic.security_groups.add(sg1)
#
nic.save()
#
url = join_urls(PORTS_URL, str(nic.id))
#
request = {'port': {"security_groups": ["123"]}}
#
response = self.put(url, params=json.dumps(request),
#
user=nic.userid)
#
self.assertEqual(response.status_code, 404)
def
test_update_port_sg
(
self
):
sg1
=
dbmf
.
SecurityGroupFactory
()
sg2
=
dbmf
.
SecurityGroupFactory
()
sg3
=
dbmf
.
SecurityGroupFactory
()
nic
=
dbmf
.
NetworkInterfaceFactory
(
device_owner
=
'vm'
)
nic
.
security_groups
.
add
(
sg1
)
nic
.
save
()
url
=
join_urls
(
PORTS_URL
,
str
(
nic
.
id
))
request
=
{
'port'
:
{
"security_groups"
:
[
str
(
sg2
.
id
),
str
(
sg3
.
id
)]}}
response
=
self
.
put
(
url
,
params
=
json
.
dumps
(
request
),
user
=
nic
.
userid
)
res
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
res
[
'port'
][
'security_groups'
],
[
str
(
sg2
.
id
),
str
(
sg3
.
id
)])
#
def test_update_port_sg(self):
#
sg1 = dbmf.SecurityGroupFactory()
#
sg2 = dbmf.SecurityGroupFactory()
#
sg3 = dbmf.SecurityGroupFactory()
#
nic = dbmf.NetworkInterfaceFactory(device_owner='vm')
#
nic.security_groups.add(sg1)
#
nic.save()
#
url = join_urls(PORTS_URL, str(nic.id))
#
request = {'port': {"security_groups": [str(sg2.id), str(sg3.id)]}}
#
response = self.put(url, params=json.dumps(request),
#
user=nic.userid)
#
res = json.loads(response.content)
#
self.assertEqual(res['port']['security_groups'],
#
[str(sg2.id), str(sg3.id)])
def
test_create_port_no_network
(
self
):
request
=
{
...
...
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