Skip to content

Commit 6ee8aa8

Browse files
committed
[Storage] De-quarantine libguestfs test and use data source instead of http import
Signed-off-by: Emanuele Prella <eprella@redhat.com>
1 parent cbf6058 commit 6ee8aa8

2 files changed

Lines changed: 17 additions & 36 deletions

File tree

tests/storage/test_libguestfs.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import pexpect
44
import pytest
55
from ocp_resources.pod import Pod
6-
from pytest_testconfig import config as py_config
76

8-
from tests.storage.utils import create_cirros_dv
9-
from utilities.constants import QUARANTINED, TIMEOUT_1MIN, UNPRIVILEGED_PASSWORD, UNPRIVILEGED_USER
7+
from utilities.constants import TIMEOUT_1MIN, TIMEOUT_2MIN, UNPRIVILEGED_PASSWORD, UNPRIVILEGED_USER
108
from utilities.infra import login_with_user_password
9+
from utilities.storage import create_dv, get_dv_size_from_datasource
1110

1211
pytestmark = pytest.mark.post_upgrade
1312

@@ -40,13 +39,23 @@ def dv_created_by_specific_user(
4039
request,
4140
namespace,
4241
client_for_test,
42+
fedora_data_source_scope_module,
43+
storage_class_name_scope_function,
4344
):
44-
yield from create_cirros_dv(
45-
name=request.param["data_volume_name"],
46-
namespace=namespace.name,
47-
storage_class=py_config["default_storage_class"],
45+
with create_dv(
46+
dv_name=request.param["data_volume_name"],
47+
storage_class=storage_class_name_scope_function,
4848
client=client_for_test,
49-
)
49+
namespace=namespace.name,
50+
source_ref={
51+
"kind": fedora_data_source_scope_module.kind,
52+
"name": fedora_data_source_scope_module.name,
53+
"namespace": fedora_data_source_scope_module.namespace,
54+
},
55+
size=get_dv_size_from_datasource(data_source=fedora_data_source_scope_module),
56+
) as dv:
57+
dv.wait_for_dv_success(timeout=TIMEOUT_2MIN)
58+
yield dv
5059

5160

5261
@pytest.fixture()
@@ -86,13 +95,8 @@ def client_for_test(request, admin_client, unprivileged_client):
8695
],
8796
indirect=True,
8897
)
89-
@pytest.mark.xfail(
90-
reason=f"{QUARANTINED}: Timeout exceeded. Tracked in CNV-62312",
91-
run=False,
92-
)
9398
@pytest.mark.s390x
9499
def test_virtctl_libguestfs_with_specific_user(
95-
client_for_test,
96100
virtctl_libguestfs_by_user,
97101
):
98102
virtctl_libguestfs_by_user.sendline("libguestfs-test-tool")

tests/storage/utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -400,29 +400,6 @@ def _wait_for_sc_update():
400400
yield edited_cdi_config
401401

402402

403-
def create_cirros_dv(
404-
namespace,
405-
name,
406-
storage_class,
407-
client,
408-
access_modes=None,
409-
volume_mode=None,
410-
dv_size=Images.Cirros.DEFAULT_DV_SIZE,
411-
):
412-
with create_dv(
413-
dv_name=f"dv-{name}",
414-
namespace=namespace,
415-
url=get_http_image_url(image_directory=Images.Cirros.DIR, image_name=Images.Cirros.QCOW2_IMG),
416-
size=dv_size,
417-
storage_class=storage_class,
418-
access_modes=access_modes,
419-
volume_mode=volume_mode,
420-
client=client,
421-
) as dv:
422-
dv.wait_for_dv_success()
423-
yield dv
424-
425-
426403
def check_snapshot_indication(snapshot, is_online):
427404
snapshot_indications = snapshot.instance.status.indications
428405
online = "Online"

0 commit comments

Comments
 (0)