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

[6.14.z] Missing content ID test #12784

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
34 changes: 34 additions & 0 deletions tests/foreman/api/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,40 @@ def test_positive_sync_kickstart_check_os(
)
assert len(os)

@pytest.mark.tier2
@pytest.mark.parametrize(
'repo_options',
**datafactory.parametrized(
{'yum': {'content_type': 'yum', 'unprotected': True, 'url': 'http://example.com'}}
),
indirect=True,
)
def test_missing_content_id(self, repo):
"""Handle several cases of missing content ID correctly

:id: f507790a-933b-4b3f-ac93-cade6967fbd2

:parametrized: yes

:expectedresults: Repository URL can be set to something new and the repo can be deleted

:BZ:2032040
"""
# Wait for async metadata generate task to finish
time.sleep(5)
# Get rid of the URL
repo.url = ''
repo = repo.update(['url'])
assert repo.url is None
# Now change the URL back
repo.url = 'http://example.com'
repo = repo.update(['url'])
assert repo.url == 'http://example.com'
# Now delete the Repo
repo.delete()
with pytest.raises(HTTPError):
repo.read()


class TestDockerRepository:
"""Tests specific to using ``Docker`` repositories."""
Expand Down