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

check extras pkgs #155

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
"paths": ["tests/misc"],
"markers": "multi_vms and not flaky and not reboot",
},
"packages": {
"description": "tests that packages can be installed correctly",
"requirements": [
"Any pool.",
],
"nb_pools": 1,
"params": {},
"paths": ["tests/packages"],
"markers": "",
},
"quicktest": {
"description": "XAPI's quicktest, not so quick by the way",
"requirements": [
Expand Down
3 changes: 2 additions & 1 deletion lib/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def get_last_yum_history_tid(self):
def yum_install(self, packages, enablerepo=None):
logging.info('Install packages: %s on host %s' % (' '.join(packages), self))
enablerepo_cmd = ['--enablerepo=%s' % enablerepo] if enablerepo is not None else []
return self.ssh(['yum', 'install', '-y'] + enablerepo_cmd + packages)
return self.ssh(['yum', 'install', '--setopt=skip_missing_names_on_install=False', '-y']
+ enablerepo_cmd + packages)

def yum_remove(self, packages):
logging.info('Remove packages: %s from host %s' % (' '.join(packages), self))
Expand Down
12 changes: 12 additions & 0 deletions tests/packages/extra/conftest.py
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()
15 changes: 15 additions & 0 deletions tests/packages/extra/test_extra_group_pkgs.py
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

benjamreis marked this conversation as resolved.
Show resolved Hide resolved
# 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)