Skip to content

Commit

Permalink
[6.15.z] Add test to sync repo having zst compression (#14492)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Mar 22, 2024
1 parent 6a88e0e commit a7bfd92
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
1 change: 0 additions & 1 deletion robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,6 @@ class Colored(Box):
'option is not present in the /etc/dnf/dnf.conf'
)


# Data File Paths
class DataFile(Box):
"""The boxed Data directory class with its attributes pointing to the Data directory files"""
Expand Down
2 changes: 1 addition & 1 deletion robottelo/constants/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
FAKE_0_YUM_REPO_STRING_BASED_VERSIONS = (
'https://fixtures.pulpproject.org/rpm-string-version-updateinfo/'
)

FAKE_ZST_REPO = 'https://fixtures.pulpproject.org/rpm-zstd-metadata'
ANSIBLE_GALAXY = 'https://galaxy.ansible.com/'
ANSIBLE_HUB = 'https://cloud.redhat.com/api/automation-hub/'
40 changes: 39 additions & 1 deletion tests/foreman/api/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

from robottelo import constants
from robottelo.config import settings
from robottelo.constants import DEFAULT_ARCHITECTURE, MIRRORING_POLICIES, REPOS
from robottelo.constants import (
DEFAULT_ARCHITECTURE,
MIRRORING_POLICIES,
REPOS,
)
from robottelo.constants.repos import FAKE_ZST_REPO
from robottelo.exceptions import CLIReturnCodeError
from robottelo.utils.datafactory import parametrized

Expand Down Expand Up @@ -186,6 +191,39 @@ def test_positive_sync_kickstart_repo(module_sca_manifest_org, target_sat):
assert rh_repo.content_counts['rpm'] > 0


def test_positive_sync_upstream_repo_with_zst_compression(
module_org, module_product, module_target_sat
):
"""Sync upstream repo having zst compression and verify it succeeds.
:id: 1eddff2a-b6b5-420b-a0e8-ba6a05c11ca4
:expectedresults: Repo sync is successful and no zst type compression errors are present in /var/log/messages.
:steps:
1. Sync upstream repository having zst type compression.
2. Assert that no errors related to compression type are present in
/var/log/messages.
3. Assert that sync was executed properly.
:BZ: 2241934
:customerscenario: true
"""
repo = module_target_sat.api.Repository(
product=module_product, content_type='yum', url=FAKE_ZST_REPO
).create()
assert repo.read().content_counts['rpm'] == 0
sync = module_product.sync()
assert sync['result'] == 'success'
assert repo.read().content_counts['rpm'] > 0
result = module_target_sat.execute(
'grep pulp /var/log/messages | grep "Cannot detect compression type"'
)
assert result.status == 1


@pytest.mark.tier1
def test_negative_upload_expired_manifest(module_org, target_sat):
"""Upload an expired manifest and attempt to refresh it
Expand Down

0 comments on commit a7bfd92

Please sign in to comment.