Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@
PVC_NOT_FOUND_ERROR,
)
from tests.utils import get_parameters_from_template
from utilities.artifactory import (
cleanup_artifactory_secret_and_config_map,
get_artifactory_config_map,
get_artifactory_secret,
get_http_image_url,
)
from utilities.constants import Images
from utilities.constants.hco import DATA_SOURCE_NAME
from utilities.constants.images import DEFAULT_FEDORA_REGISTRY_URL
from utilities.constants.pytest import QUARANTINED
from utilities.constants.storage import BIND_IMMEDIATE_ANNOTATION
from utilities.constants.storage import BIND_IMMEDIATE_ANNOTATION, REGISTRY_STR
from utilities.constants.timeouts import (
TIMEOUT_5MIN,
TIMEOUT_10MIN,
Expand All @@ -47,20 +41,13 @@

@contextmanager
def dv_for_data_source(name, data_source, admin_client):
artifactory_secret = get_artifactory_secret(namespace=data_source.namespace)
artifactory_config_map = get_artifactory_config_map(namespace=data_source.namespace)
with DataVolume(
client=admin_client,
name=name,
namespace=data_source.namespace,
source_dict=construct_datavolume_source_dict(
# underlying OS is not relevant
source="http",
url=get_http_image_url(image_directory=Images.Cirros.DIR, image_name=Images.Cirros.QCOW2_IMG),
secret_name=artifactory_secret.name,
cert_configmap_name=artifactory_config_map.name,
),
size=Images.Cirros.DEFAULT_DV_SIZE,
# underlying OS is not relevant
source_dict=construct_datavolume_source_dict(source=REGISTRY_STR, url=DEFAULT_FEDORA_REGISTRY_URL),
size=Images.Fedora.DEFAULT_DV_SIZE,
Comment on lines +49 to +50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to clone from a golden image to reduce the dependency on quay?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean from a DataSource?
It's not possible, the test idea is to create a DV while the boot sources are down, and then to bring them up again after the PVC is created.
So there no source to clone from when creating the DV.

storage_class=py_config["default_storage_class"],
annotations=BIND_IMMEDIATE_ANNOTATION,
api_name="storage",
Expand All @@ -71,9 +58,6 @@ def dv_for_data_source(name, data_source, admin_client):
expected_message=DATA_SOURCE_READY_FOR_CONSUMPTION_MESSAGE,
)
yield dv
cleanup_artifactory_secret_and_config_map(
artifactory_secret=artifactory_secret, artifactory_config_map=artifactory_config_map
)


def opt_in_status_str(opt_in):
Expand All @@ -100,7 +84,7 @@ def wait_for_data_source_reconciliation_after_update(
def wait_for_data_source_unchanged_referenced_volume(data_source, volume_name):
try:
for sample in TimeoutSampler(
wait_timeout=TIMEOUT_10MIN,
wait_timeout=TIMEOUT_5MIN,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait_for_data_source_unchanged_referenced_volume is only used at one place under test_data_source_with_existing_golden_image_pvc.
Before we hit test body, fixtures already settles and verified

  • disable disabled_common_boot_image_import
  • manual DV succeeded, datasources ready on that pvc
  • enabled_common_boot_image_import_feature_gate makes sure that ds, dic,ssp.hco all looks good.
    inside test body ,

wait_for_condition_message_value waits for ready message which means it's stable so instead of wait_for_data_source_unchanged_referenced_volume , which is another wait , should we directly assert? wait_for_data_source_unchanged_referenced_volume will keep polling for 5 mins even if we get what we want . why we expect something would change in that 5 mins because everything is already stable when we run wait_for_data_source_unchanged_referenced_volume

sleep=5,
func=lambda: data_source.source.name != volume_name,
):
Expand Down