Skip to content

Commit

Permalink
WIP Test import export
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Jul 11, 2024
1 parent 568be12 commit 4277b1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pulp_rpm/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import uuid

import pytest
Expand Down Expand Up @@ -71,7 +72,7 @@ def rpm_repository_factory(rpm_repository_api, gen_object_with_cleanup):
"""A factory to generate an RPM Repository with auto-deletion after the test run."""

def _rpm_repository_factory(pulp_domain=None, **body):
data = {"name": str(uuid.uuid4())}
data = {"name": str(uuid.uuid4()), "description": os.environ["PYTEST_CURRENT_TEST"]}
data.update(body)
kwargs = {}
if pulp_domain:
Expand Down
7 changes: 7 additions & 0 deletions pulp_rpm/tests/functional/api/test_pulpimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ def test_clean_import(

for repo in exported_repos:
monitor_task(rpm_repository_api.delete(repo.pulp_href).task)

# At this time there should be no other repository in the system.
result = rpm_repository_api.list()
if result.count != 0:
descriptions = [r["description"] for r in result.results]
pytest.fail(f"Leftover repositories: {descriptions}")

monitor_task(pulpcore_bindings.OrphansCleanupApi.cleanup({"orphan_protection_time": 0}).task)

existing_repos = rpm_repository_api.list().count
Expand Down

0 comments on commit 4277b1d

Please sign in to comment.