1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Change ports to adapters in VirtualBox API entry points.

This commit is contained in:
Jeremy 2015-01-31 12:07:30 -07:00
parent 22369ade49
commit 8a00d30e23
2 changed files with 7 additions and 7 deletions

View File

@ -227,7 +227,7 @@ class VirtualBoxHandler:
response.set_status(204)
@Route.post(
r"/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio",
r"/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio",
parameters={
"uuid": "Instance UUID",
"adapter_id": "Adapter where the nio should be added"
@ -251,7 +251,7 @@ class VirtualBoxHandler:
@classmethod
@Route.delete(
r"/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio",
r"/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio",
parameters={
"uuid": "Instance UUID",
"adapter_id": "Adapter from where the nio should be removed"

View File

@ -88,24 +88,24 @@ def test_vbox_reload(server, vm):
def test_vbox_nio_create_udp(server, vm):
response = server.post("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), {"type": "nio_udp",
response = server.post("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), {"type": "nio_udp",
"lport": 4242,
"rport": 4343,
"rhost": "127.0.0.1"},
example=True)
assert response.status == 201
assert response.route == "/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio"
assert response.route == "/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio"
assert response.json["type"] == "nio_udp"
def test_vbox_delete_nio(server, vm):
server.post("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), {"type": "nio_udp",
server.post("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), {"type": "nio_udp",
"lport": 4242,
"rport": 4343,
"rhost": "127.0.0.1"})
response = server.delete("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), example=True)
response = server.delete("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), example=True)
assert response.status == 204
assert response.route == "/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio"
assert response.route == "/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio"
def test_vpcs_update(server, vm, free_console_port):