From 8da3960583edb1afd8aa3d007aa93559df98c903 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Mon, 17 Jun 2024 11:31:36 +0200 Subject: [PATCH 1/2] Update repo checksum with one supported --- tests/foreman/api/test_capsulecontent.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index 562105856c6..99a2b1d3729 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -188,7 +188,7 @@ def test_positive_checksum_sync( cvv = cvv.read() assert len(cvv.environment) == 2 - # Verify repodata's checksum type is sha256, not sha1 on capsule + # Verify repodata's checksum type is sha256, not sha512 on capsule repo_url = module_capsule_configured.get_published_repo_url( org=function_org.label, prod=function_product.label, @@ -198,11 +198,11 @@ def test_positive_checksum_sync( ) repomd = get_repomd(repo_url) checksum_types = re.findall(r'(?<=checksum type=").*?(?=")', repomd) - assert "sha1" not in checksum_types + assert "sha512" not in checksum_types assert "sha256" in checksum_types - # Update repo's checksum type to sha1 - repo.checksum_type = 'sha1' + # Update repo's checksum type to sha512 + repo.checksum_type = 'sha512' repo = repo.update(['checksum_type']) # Sync, publish, and promote repo @@ -221,10 +221,10 @@ def test_positive_checksum_sync( cvv = cvv.read() assert len(cvv.environment) == 2 - # Verify repodata's checksum type has updated to sha1 on capsule + # Verify repodata's checksum type has updated to sha512 on capsule repomd = get_repomd(repo_url) checksum_types = re.findall(r'(?<=checksum type=").*?(?=")', repomd) - assert "sha1" in checksum_types + assert "sha512" in checksum_types assert "sha256" not in checksum_types @pytest.mark.skip_if_open("BZ:2025494") From 62eb574a8000be0ce58be8bd440175b44747a97a Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Tue, 18 Jun 2024 10:29:54 +0200 Subject: [PATCH 2/2] Put checksums in variables --- tests/foreman/api/test_capsulecontent.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index 99a2b1d3729..d03f6f3aa24 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -155,10 +155,12 @@ def test_positive_checksum_sync( :CaseImportance: Critical """ + original_checksum = 'sha256' + new_checksum = 'sha512' # Create repository with sha256 checksum type repo = target_sat.api.Repository( product=function_product, - checksum_type='sha256', + checksum_type=original_checksum, mirroring_policy='additive', download_policy='immediate', ).create() @@ -198,11 +200,11 @@ def test_positive_checksum_sync( ) repomd = get_repomd(repo_url) checksum_types = re.findall(r'(?<=checksum type=").*?(?=")', repomd) - assert "sha512" not in checksum_types - assert "sha256" in checksum_types + assert new_checksum not in checksum_types + assert original_checksum in checksum_types # Update repo's checksum type to sha512 - repo.checksum_type = 'sha512' + repo.checksum_type = new_checksum repo = repo.update(['checksum_type']) # Sync, publish, and promote repo @@ -224,8 +226,8 @@ def test_positive_checksum_sync( # Verify repodata's checksum type has updated to sha512 on capsule repomd = get_repomd(repo_url) checksum_types = re.findall(r'(?<=checksum type=").*?(?=")', repomd) - assert "sha512" in checksum_types - assert "sha256" not in checksum_types + assert new_checksum in checksum_types + assert original_checksum not in checksum_types @pytest.mark.skip_if_open("BZ:2025494") @pytest.mark.e2e