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

Add copr chroot tests #1594

Merged
merged 1 commit into from
Nov 26, 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
97 changes: 97 additions & 0 deletions dnf-behave-tests/dnf/plugins-core/copr-chroot.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@dnf5
# These tests need to be marked destructive because copr
# doesn't use repositories in installroot, this is tracked as:
# https://github.com/rpm-software-management/dnf5/issues/1497
@destructive
Feature: Test the COPR plugin chroot argument


Background:
Given I create directory "/{context.dnf.tempdir}/copr"
And I start http server "copr" at "{context.dnf.tempdir}/copr"
And I create and substitute file "//etc/dnf/plugins/copr.conf" with
"""
[main]
distribution = Fedora
releasever = 31
[testhub]
hostname = localhost
protocol = http
port = {context.dnf.ports[copr]}
"""
And I create and substitute file "/{context.dnf.tempdir}/copr/api_3/rpmrepo/testuser/testproject/Fedora-31/index.html" with
"""
{{
"dependencies": [],
"directories": {{
"testproject": {{}}
}},
"repos": {{
"Fedora-32": {{
"arch": {{
"x86_64": {{
"opts": {{
"id": "f32"
}}
}}
}}
}},
}},
"results_url": "http://project_base_url/"
}}
"""


Scenario: Test enabling a repo which doesn't have current default chroot available
When I execute dnf with args "copr enable testhub/testuser/testproject"
Then the exit code is 1
And stdout is empty
And stderr is
"""
<REPOSYNC>
Chroot not found in the given Copr project (Fedora-31-x86_64).
You can choose one of the available chroots explicitly:
Fedora-32-x86_64
"""


Scenario: Test enabling repo with specified missing chroot
When I execute dnf with args "copr enable testhub/testuser/testproject Fedora-30-x86_64"
Then the exit code is 1
And stdout is empty
And stderr is
"""
<REPOSYNC>
Chroot not found in the given Copr project (Fedora-30-x86_64).
You can choose one of the available chroots explicitly:
Fedora-32-x86_64
"""


Scenario: Test enabling a repo with manually specified chroot (different to current) uses opts
When I execute dnf with args "copr enable testhub/testuser/testproject Fedora-32-x86_64"
Then the exit code is 0
And stdout is empty
And stderr is
"""
<REPOSYNC>
Enabling a Copr repository. Please note that this repository is not part
of the main distribution, and quality may vary.

The Fedora Project does not exercise any power over the contents of
this repository beyond the rules outlined in the Copr FAQ at
<https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>,
and packages are not held to any quality or security level.

Please do not file bug reports about these packages in Fedora
Bugzilla. In case of problems, contact the owner of this repository.
"""
# --use-host-config has to be used because of https://github.com/rpm-software-management/dnf5/issues/1497
When I execute dnf with args "repo list f32 --use-host-config"
Then the exit code is 0
And stdout is
"""
repo id repo name
f32 Copr repo for testproject owned by testuser
"""
And stderr is empty
Loading