Skip to content

Commit 3a8984b

Browse files
committed
Merge branch 'main' into testCustomCliDownload
2 parents 3024571 + 106c880 commit 3a8984b

9 files changed

Lines changed: 41 additions & 30 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
stages: [pre-commit]
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.13.3
16+
rev: v0.14.0
1717
hooks:
1818
- id: ruff
1919
stages: [pre-commit]

tests/global_config_arm64.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@
5757
latest_rhel_os_dict = get_latest_os_dict_list(os_list=[rhel_os_matrix])[0]
5858

5959
# Modify instance_type_rhel_os_matrix for arm64
60-
instance_type_rhel_os_matrix = generate_linux_instance_type_os_matrix(os_name="rhel", preferences=[RHEL10_PREFERENCE])
60+
instance_type_rhel_os_matrix = generate_linux_instance_type_os_matrix(
61+
os_name="rhel", preferences=[RHEL10_PREFERENCE], arch_suffix=ARM_64
62+
)
6163
instance_type_centos_os_matrix = generate_linux_instance_type_os_matrix(
6264
os_name="centos.stream", preferences=[CENTOS_STREAM10_PREFERENCE]
6365
)
6466
instance_type_fedora_os_matrix = generate_linux_instance_type_os_matrix(
65-
os_name=OS_FLAVOR_FEDORA, preferences=[OS_FLAVOR_FEDORA]
67+
os_name=OS_FLAVOR_FEDORA, preferences=[OS_FLAVOR_FEDORA], arch_suffix=ARM_64
6668
)
67-
for os_matrix_dict in instance_type_rhel_os_matrix + instance_type_centos_os_matrix + instance_type_fedora_os_matrix:
68-
for os_params in os_matrix_dict.values():
69-
os_params[PREFERENCE_STR] += f".{ARM_64}"
69+
7070

7171
for _dir in dir():
7272
if not config: # noqa: F821

tests/global_config_s390x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
centos_os_matrix = generate_os_matrix_dict(os_name="centos", supported_operating_systems=["centos-stream-9"])
2626

2727
instance_type_rhel_os_matrix = generate_linux_instance_type_os_matrix(
28-
os_name="rhel", preferences=[utilities.constants.RHEL9_PREFERENCE]
28+
os_name="rhel", preferences=[utilities.constants.RHEL9_PREFERENCE], arch_suffix=S390X
2929
)
3030

3131
latest_rhel_os_dict, latest_fedora_os_dict, latest_centos_os_dict = get_latest_os_dict_list(

tests/install_upgrade_operators/console_cli_download/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def all_virtctl_urls_scope_function(admin_client):
3838

3939

4040
@pytest.fixture(scope="class")
41-
def all_virtctl_urls_scope_class(original_virtctl_console_cli_downloads_spec_links_scope_class):
41+
def all_virtctl_urls_scope_class(admin_client):
4242
return get_all_console_links(
43-
console_cli_downloads_spec_links=original_virtctl_console_cli_downloads_spec_links_scope_class
43+
console_cli_downloads_spec_links=get_console_spec_links(admin_client=admin_client, name=VIRTCTL_CLI_DOWNLOADS)
4444
)
4545

4646

@@ -106,5 +106,5 @@ def updated_cluster_ingress_downloads_spec_links(request, admin_client, hco_name
106106
yield
107107
validate_custom_cli_downloads_urls_updated(
108108
admin_client=admin_client,
109-
original_virtctl_console_cli_downloads_spec_links=all_virtctl_urls_scope_class,
109+
original_links=all_virtctl_urls_scope_class,
110110
)

tests/install_upgrade_operators/console_cli_download/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def validate_custom_cli_downloads_urls_updated(
1414
admin_client: DynamicClient,
1515
new_hostname: str | None = None,
16-
original_virtctl_console_cli_downloads_spec_links: list[str] | None = None,
16+
original_links: list[str] | None = None,
1717
) -> None:
1818
"""
1919
Validates that console CLI download URLs have been properly updated.
@@ -27,7 +27,7 @@ def validate_custom_cli_downloads_urls_updated(
2727
new_hostname (str, optional): New hostname that should be present in all URLs.
2828
If provided, validates that all URLs contain this hostname.
2929
Mutually exclusive with original_virtctl_console_cli_downloads_spec_links.
30-
original_virtctl_console_cli_downloads_spec_links (list[str], optional):
30+
original_links (list[str], optional):
3131
Original list of CLI download URLs. If provided, validates that current
3232
URLs match these original URLs.
3333
Mutually exclusive with new_hostname.
@@ -40,7 +40,7 @@ def validate_custom_cli_downloads_urls_updated(
4040
ValueError: If both new_hostname and original_virtctl_console_cli_downloads_spec_links
4141
are provided, or if neither is provided.
4242
"""
43-
if (new_hostname is None) == (original_virtctl_console_cli_downloads_spec_links is None):
43+
if (new_hostname is None) == (original_links is None):
4444
raise ValueError(
4545
"Exactly one of 'new_hostname' or 'original_virtctl_console_cli_downloads_spec_links' "
4646
"must be provided, not both or neither."
@@ -58,18 +58,18 @@ def validate_custom_cli_downloads_urls_updated(
5858
try:
5959
for sample in samples:
6060
current_cli_spec_links = [url.href for url in sample]
61-
if original_virtctl_console_cli_downloads_spec_links:
62-
if sorted(current_cli_spec_links) == sorted(original_virtctl_console_cli_downloads_spec_links):
61+
if original_links:
62+
if sorted(current_cli_spec_links) == sorted(original_links):
6363
return
6464
elif new_hostname:
6565
urls_not_updated_with_new_hostname = [url for url in current_cli_spec_links if new_hostname not in url]
6666
if not urls_not_updated_with_new_hostname:
6767
return
6868
except TimeoutExpiredError:
69-
if original_virtctl_console_cli_downloads_spec_links:
69+
if original_links:
7070
LOGGER.error(
7171
f"Failed to update cluster ingress downloads spec links to the original links: "
72-
f"original_cli_spec_links: {original_virtctl_console_cli_downloads_spec_links}, "
72+
f"original_cli_spec_links: {original_links}, "
7373
f"current_cli_spec_links: {current_cli_spec_links}"
7474
)
7575
else:

tests/network/conftest.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def network_sanity(
224224
network_overhead,
225225
sriov_workers,
226226
ipv4_supported_cluster,
227+
ipv6_supported_cluster,
227228
conformance_tests,
228229
):
229230
"""
@@ -310,13 +311,13 @@ def _verify_sriov():
310311
f"has {len(sriov_workers)} SRIOV-capable worker nodes"
311312
)
312313

313-
def _verify_ipv4():
314-
if any(test.get_closest_marker("ipv4") for test in collected_tests):
315-
LOGGER.info("Verifying if the cluster supports running IPV4 tests...")
316-
if not ipv4_supported_cluster:
317-
failure_msgs.append("IPv4 is not supported in this cluster")
314+
def _verify_ip_family(family, is_supported_in_cluster):
315+
if any(test.get_closest_marker(family) for test in collected_tests):
316+
LOGGER.info(f"Verifying if the cluster supports running {family} tests...")
317+
if not is_supported_in_cluster:
318+
failure_msgs.append(f"{family} is not supported in this cluster")
318319
else:
319-
LOGGER.info("Validated network lane is running against an IPV4 supported cluster")
320+
LOGGER.info(f"Validated network lane is running against an {family} supported cluster")
320321

321322
def _verify_bgp_env_vars():
322323
"""Verify if the cluster supports running BGP tests.
@@ -343,7 +344,8 @@ def _verify_bgp_env_vars():
343344
_verify_service_mesh()
344345
_verify_jumbo_frame()
345346
_verify_sriov()
346-
_verify_ipv4()
347+
_verify_ip_family(family="ipv4", is_supported_in_cluster=ipv4_supported_cluster)
348+
_verify_ip_family(family="ipv6", is_supported_in_cluster=ipv6_supported_cluster)
347349
_verify_bgp_env_vars()
348350

349351
if failure_msgs:

tests/storage/fs_overhead/test_fs_overhead.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ def test_import_vm_with_specify_fs_overhead(updated_fs_overhead_20_with_hco, vm_
9393
pvc=PersistentVolumeClaim(name=vm_metadata["name"], namespace=vm_metadata["namespace"])
9494
),
9595
requested_size=bitmath.GiB(
96-
int(vm_for_fs_overhead_test.data_volume_template["spec"]["storage"]["resources"]["requests"]["storage"][0])
96+
int(
97+
bitmath.parse_string_unsafe(
98+
vm_for_fs_overhead_test.data_volume_template["spec"]["storage"]["resources"]["requests"]["storage"]
99+
).value
100+
)
97101
),
98102
)
99103

@@ -105,5 +109,5 @@ def test_upload_dv_with_specify_fs_overhead(
105109
):
106110
assert_fs_overhead_added(
107111
actual_size=get_pvc_size_gib(pvc=uploaded_cirros_dv.pvc),
108-
requested_size=bitmath.GiB(int(Images.Cirros.DEFAULT_DV_SIZE[0])),
112+
requested_size=bitmath.GiB(int(bitmath.parse_string_unsafe(Images.Cirros.DEFAULT_DV_SIZE).value)),
109113
)

tests/virt/node/migration_and_maintenance/test_vm_disk_load_with_migration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ def running_fio_in_vm(vm_with_fio):
3737
# Random write/read - create a 1G file, and perform 4KB reads and writes using a 75%/25%
3838
LOGGER.info("Running fio in VM")
3939
fio_cmd = shlex.split(
40-
"sudo nohup /usr/bin/fio --loops=400 --runtime=600 --randrepeat=1 --ioengine=libaio --direct=1 "
40+
"sudo nohup /usr/bin/fio --time_based --runtime=600 --randrepeat=1 --ioengine=libaio --direct=1 "
4141
"--gtod_reduce=1 --name=test --filename=/home/fedora/random_read_write.fio --bs=4k --iodepth=64 "
4242
"--size=1G --readwrite=randrw --rwmixread=75 --numjobs=8 >& /dev/null &"
4343
)
4444
run_ssh_commands(host=vm_with_fio.ssh_exec, commands=fio_cmd)
45+
get_disk_usage(ssh_exec=vm_with_fio.ssh_exec)
4546

4647

4748
def get_disk_usage(ssh_exec):

utilities/os_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,17 @@ def generate_os_matrix_dict(os_name: str, supported_operating_systems: list[str]
241241
return os_formatted_list
242242

243243

244-
def generate_linux_instance_type_os_matrix(os_name: str, preferences: list[str]) -> list[dict[str, dict[str, Any]]]:
244+
def generate_linux_instance_type_os_matrix(
245+
os_name: str, preferences: list[str], arch_suffix: str | None = None
246+
) -> list[dict[str, dict[str, Any]]]:
245247
"""
246248
Generate a list of dictionaries representing the instance type matrix for a Linux OS type.
247249
Each dictionary represents a specific instance type and its configuration.
248250
249251
Args:
250252
os_name (str): The name of the OS.
251253
preferences (list[str]): A list of preferences for the instance types. Preference format is "<os>.<version>".
254+
arch_suffix: Optional architecture suffix. Example: "s390x", "arm64" . Omit to keep original preference.
252255
253256
Returns:
254257
list[dict[str, dict[str, Any]]]: A list of dictionaries representing the instance type matrix.
@@ -269,13 +272,14 @@ def _format_data_source_name(preference_name: str) -> str:
269272
instance_types: list[dict[str, dict[str, Any]]] = []
270273

271274
for preference in preferences:
275+
arch_preference = f"{preference}.{arch_suffix}" if arch_suffix else preference
272276
preference_config: dict[str, Any] = {
273-
PREFERENCE_STR: preference,
277+
PREFERENCE_STR: arch_preference,
274278
DATA_SOURCE_NAME: _format_data_source_name(preference_name=preference),
275279
}
276280

277281
if preference == latest_os:
278282
preference_config[LATEST_RELEASE_STR] = True
279283

280-
instance_types.append({preference: preference_config})
284+
instance_types.append({arch_preference: preference_config})
281285
return instance_types

0 commit comments

Comments
 (0)