Streamline the create iso workflow, removing the attach step (#1069)

This commit is contained in:
Daniel Markstedt
2023-01-15 07:38:41 -08:00
committed by GitHub
parent 649655ba40
commit 6ca140d842
4 changed files with 12 additions and 63 deletions

View File

@@ -3,7 +3,6 @@ import uuid
import os
from conftest import (
SCSI_ID,
FILE_SIZE_1_MIB,
STATUS_SUCCESS,
)
@@ -333,8 +332,6 @@ def test_create_iso_from_url(
httpserver,
http_client,
list_files,
list_attached_images,
detach_devices,
delete_file,
):
test_file_name = str(uuid.uuid4())
@@ -355,7 +352,6 @@ def test_create_iso_from_url(
response = http_client.post(
"/files/create_iso",
data={
"scsi_id": SCSI_ID,
"type": ISO_TYPE,
"url": url,
},
@@ -366,16 +362,13 @@ def test_create_iso_from_url(
assert response.status_code == 200
assert response_data["status"] == STATUS_SUCCESS
assert iso_file_name in list_files()
assert iso_file_name in list_attached_images()
assert (
response_data["messages"][0]["message"]
== f"CD-ROM image {iso_file_name} with type {ISO_TYPE} was created "
f"and attached to SCSI ID {SCSI_ID}"
== f"CD-ROM image {iso_file_name} with type {ISO_TYPE} was created."
)
# Cleanup
detach_devices()
delete_file(iso_file_name)
@@ -384,8 +377,6 @@ def test_create_iso_from_local_file(
http_client,
create_test_image,
list_files,
list_attached_images,
detach_devices,
delete_file,
):
test_file_name = create_test_image()
@@ -396,7 +387,6 @@ def test_create_iso_from_local_file(
response = http_client.post(
"/files/create_iso",
data={
"scsi_id": SCSI_ID,
"type": ISO_TYPE,
"file": test_file_name,
},
@@ -407,16 +397,13 @@ def test_create_iso_from_local_file(
assert response.status_code == 200
assert response_data["status"] == STATUS_SUCCESS
assert iso_file_name in list_files()
assert iso_file_name in list_attached_images()
assert (
response_data["messages"][0]["message"]
== f"CD-ROM image {iso_file_name} with type {ISO_TYPE} was created "
f"and attached to SCSI ID {SCSI_ID}"
== f"CD-ROM image {iso_file_name} with type {ISO_TYPE} was created."
)
# Cleanup
detach_devices()
delete_file(iso_file_name)