Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo checksum with one supported #15426

Merged
merged 2 commits into from
Jun 18, 2024
Merged
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
20 changes: 11 additions & 9 deletions tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -188,7 +190,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
vsedmik marked this conversation as resolved.
Show resolved Hide resolved
repo_url = module_capsule_configured.get_published_repo_url(
org=function_org.label,
prod=function_product.label,
Expand All @@ -198,11 +200,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 "sha256" in checksum_types
assert new_checksum not in checksum_types
assert original_checksum in checksum_types

# Update repo's checksum type to sha1
repo.checksum_type = 'sha1'
# Update repo's checksum type to sha512
repo.checksum_type = new_checksum
repo = repo.update(['checksum_type'])

# Sync, publish, and promote repo
Expand All @@ -221,11 +223,11 @@ 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 "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
Expand Down