|
|
|
@ -49,6 +49,7 @@ def vm(server, project, base_params):
|
|
|
|
|
def initial_config_file(project, vm):
|
|
|
|
|
return os.path.join(project.path, "project-files", "iou", vm["vm_id"], "initial-config.cfg")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_iou_create(server, project, base_params):
|
|
|
|
|
response = server.post("/projects/{project_id}/iou/vms".format(project_id=project.id), base_params)
|
|
|
|
|
assert response.status == 201
|
|
|
|
@ -59,7 +60,7 @@ def test_iou_create(server, project, base_params):
|
|
|
|
|
assert response.json["ethernet_adapters"] == 2
|
|
|
|
|
assert response.json["ram"] == 256
|
|
|
|
|
assert response.json["nvram"] == 128
|
|
|
|
|
assert response.json["l1_keepalives"] == False
|
|
|
|
|
assert response.json["l1_keepalives"] is False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_iou_create_with_params(server, project, base_params):
|
|
|
|
@ -80,7 +81,7 @@ def test_iou_create_with_params(server, project, base_params):
|
|
|
|
|
assert response.json["ethernet_adapters"] == 0
|
|
|
|
|
assert response.json["ram"] == 1024
|
|
|
|
|
assert response.json["nvram"] == 512
|
|
|
|
|
assert response.json["l1_keepalives"] == True
|
|
|
|
|
assert response.json["l1_keepalives"] is True
|
|
|
|
|
with open(initial_config_file(project, response.json)) as f:
|
|
|
|
|
assert f.read() == params["initial_config"]
|
|
|
|
|
|
|
|
|
@ -95,7 +96,7 @@ def test_iou_get(server, project, vm):
|
|
|
|
|
assert response.json["ethernet_adapters"] == 2
|
|
|
|
|
assert response.json["ram"] == 256
|
|
|
|
|
assert response.json["nvram"] == 128
|
|
|
|
|
assert response.json["l1_keepalives"] == False
|
|
|
|
|
assert response.json["l1_keepalives"] is False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_iou_start(server, vm):
|
|
|
|
@ -145,10 +146,11 @@ def test_iou_update(server, vm, tmpdir, free_console_port, project):
|
|
|
|
|
assert response.json["serial_adapters"] == 0
|
|
|
|
|
assert response.json["ram"] == 512
|
|
|
|
|
assert response.json["nvram"] == 2048
|
|
|
|
|
assert response.json["l1_keepalives"] == True
|
|
|
|
|
assert response.json["l1_keepalives"] is True
|
|
|
|
|
with open(initial_config_file(project, response.json)) as f:
|
|
|
|
|
assert f.read() == "hostname test"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_iou_nio_create_udp(server, vm):
|
|
|
|
|
response = server.post("/projects/{project_id}/iou/vms/{vm_id}/adapters/1/ports/0/nio".format(project_id=vm["project_id"], vm_id=vm["vm_id"]), {"type": "nio_udp",
|
|
|
|
|
"lport": 4242,
|
|
|
|
|