-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new test to check that extras pkgs can be installed
This test gets a list of extra packages from https://reports.xcp-ng.org/<xcp-ng-version>/extra_installable.txt and checks that: - the package is available and dependencies resolved using yumdownloader - all packages can be installed. Before installing packages it saves the yum state and restores it after the installation. As tests are taking some time we added them in their onw job. Signed-off-by: Guillaume <[email protected]>
- Loading branch information
1 parent
dfc8a7e
commit 7ce24d3
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import logging | ||
import pytest | ||
import urllib.request | ||
|
||
@pytest.fixture(scope="session") | ||
def extra_pkgs(host): | ||
version = host.xcp_version | ||
url = f"https://reports.xcp-ng.org/{version}/extra_installable.txt" | ||
|
||
logging.info(f"Getting extra packages from {url}") | ||
response = urllib.request.urlopen(url) | ||
return response.read().decode('utf-8').splitlines() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Explicitly import package-scoped fixtures (see explanation in pkgfixtures.py) | ||
from pkgfixtures import host_with_saved_yum_state | ||
|
||
# Requirements: | ||
# From --hosts parameter: | ||
# - host(A1): any master host of a pool, with access to XCP-ng RPM repositories and reports.xcp-ng.org. | ||
|
||
def test_extra_group_packages_url_resolved(host, extra_pkgs): | ||
for p in extra_pkgs: | ||
host.ssh(['yumdownloader', '--resolve', '--urls', p]) | ||
|
||
def test_extra_group_packages_can_be_installed(host_with_saved_yum_state, extra_pkgs): | ||
# Just try to install all packages together. Installing them one by one | ||
# takes too much time due to the generation of the initrd. | ||
host_with_saved_yum_state.yum_install(extra_pkgs) |