Skip to content

Commit

Permalink
[6.15.z] Fix SRPMs label in hammer repository info (#13975)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Feb 2, 2024
1 parent 7d4a1a1 commit 2d62ffa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
13 changes: 5 additions & 8 deletions tests/foreman/cli/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def test_positive_synchronize_rpm_repo_ignore_SRPM(
target_sat.cli.Repository.synchronize({'id': repo['id']})
repo = target_sat.cli.Repository.info({'id': repo['id']})
assert repo['sync']['status'] == 'Success'
assert repo['content-counts']['source-rpms'] == '0', 'content not ignored correctly'
assert repo['content-counts']['srpms'] == '0', 'content not ignored correctly'

@pytest.mark.tier1
@pytest.mark.skipif(
Expand Down Expand Up @@ -1839,8 +1839,7 @@ def test_positive_upload_remove_srpm_content(self, repo, target_sat):
)
assert f"Successfully uploaded file '{SRPM_TO_UPLOAD}'" in result[0]['message']
assert (
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms'])
== 1
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['srpms']) == 1
)

# Remove uploaded SRPM
Expand All @@ -1852,8 +1851,7 @@ def test_positive_upload_remove_srpm_content(self, repo, target_sat):
}
)
assert (
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms'])
== 0
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['srpms']) == 0
)

@pytest.mark.upgrade
Expand Down Expand Up @@ -1895,8 +1893,7 @@ def test_positive_srpm_list_end_to_end(self, repo, target_sat):
assert len(srpm_list) == 1
assert target_sat.cli.Srpm.info({'id': srpm_list[0]['id']})[0]['filename'] == SRPM_TO_UPLOAD
assert (
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms'])
== 1
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['srpms']) == 1
)
assert (
len(
Expand Down Expand Up @@ -1944,7 +1941,7 @@ def test_positive_srpm_list_end_to_end(self, repo, target_sat):
}
)
assert int(
target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms']
target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['srpms']
) == len(target_sat.cli.Srpm.list({'repository-id': repo['id']}))

@pytest.mark.tier1
Expand Down
16 changes: 9 additions & 7 deletions tests/foreman/cli/test_satellitesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def function_synced_rh_repo(request, target_sat, function_sca_manifest_org):
)
# Update the download policy to 'immediate' and sync
target_sat.cli.Repository.update({'download-policy': 'immediate', 'id': repo['id']})
target_sat.cli.Repository.synchronize({'id': repo['id']}, timeout=7200000)
target_sat.cli.Repository.synchronize({'id': repo['id']}, timeout='2h')
repo = target_sat.cli.Repository.info(
{
'organization-id': function_sca_manifest_org.id,
Expand Down Expand Up @@ -605,8 +605,9 @@ def test_positive_export_import_cv_end_to_end(
'organization-id': function_import_org.id,
}
)
for item in ['packages', 'source-rpms', 'package-groups', 'errata', 'module-streams']:
assert exported_repo['content-counts'][item] == imported_repo['content-counts'][item]
assert (
exported_repo['content-counts'] == imported_repo['content-counts']
), 'Exported and imported counts do not match'

@pytest.mark.upgrade
@pytest.mark.tier3
Expand Down Expand Up @@ -940,7 +941,7 @@ def test_positive_export_import_redhat_cv(
# Export cv
export = target_sat.cli.ContentExport.completeVersion(
{'id': cvv['id'], 'organization-id': function_sca_manifest_org.id},
timeout=7200000,
timeout='2h',
)
# Verify export directory is not empty
assert target_sat.validate_pulp_filepath(function_sca_manifest_org, PULP_EXPORT_DIR) != ''
Expand All @@ -952,7 +953,7 @@ def test_positive_export_import_redhat_cv(
target_sat.cli.Settings.set({'name': 'subscription_connection_enabled', 'value': "No"})
target_sat.cli.ContentImport.version(
{'organization-id': function_import_org_with_manifest.id, 'path': import_path},
timeout=7200000,
timeout='2h',
)
importing_cvv = target_sat.cli.ContentView.info(
{'name': cv_name, 'organization-id': function_import_org_with_manifest.id}
Expand All @@ -977,8 +978,9 @@ def test_positive_export_import_redhat_cv(
'organization-id': function_import_org_with_manifest.id,
}
)
for item in ['packages', 'source-rpms', 'package-groups', 'errata', 'module-streams']:
assert exported_repo['content-counts'][item] == imported_repo['content-counts'][item]
assert (
exported_repo['content-counts'] == imported_repo['content-counts']
), 'Exported and imported counts do not match'

@pytest.mark.tier2
def test_positive_export_cv_with_on_demand_repo(
Expand Down

0 comments on commit 2d62ffa

Please sign in to comment.