Skip to content

Commit

Permalink
WIP install: add installation of xcp-ng 8.0 and 8.1, upgrades to 8.3b2
Browse files Browse the repository at this point in the history
FIXME:
- firstboot handling is different from 8.2+
  • Loading branch information
ydirson committed Jun 17, 2024
1 parent d1b11d6 commit 1fb21bb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
2 changes: 2 additions & 0 deletions data.py-dist
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ VM_IMAGES = {

# FIXME: use URLs and an optional cache?
ISO_IMAGES = {
# 'xcpng-8.0': "/home/user/iso/xcp-ng-8.0.0.iso",
# 'xcpng-8.1': "/home/user/iso/xcp-ng-8.1.0-2.iso",
# 'xcpng-8.2.0': "/home/user/iso/xcp-ng-8.2.0.iso",
# 'xcpng-8.2.1': "/home/user/iso/xcp-ng-8.2.1.iso",
# 'xcpng-8.2.1-2023': "/home/user/iso/xcp-ng-8.2.1-20231130.iso",
Expand Down
51 changes: 42 additions & 9 deletions tests/install/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
@pytest.mark.dependency()
class TestNested:
@pytest.mark.parametrize("iso_version", (
"80", "81",
"ch821.1", "xs8",
"821.1", "83b2",
))
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
@pytest.mark.installer_iso(
lambda version: {
"80": "xcpng-8.0",
"81": "xcpng-8.1",
"821.1": "xcpng-8.2.1-2023",
"83b2": "xcpng-8.3-beta2",
"ch821.1": "ch-8.2.1-23",
Expand Down Expand Up @@ -144,11 +147,13 @@ def test_install(self, request, firmware, iso_version, iso_remaster, create_vms)
@pytest.mark.usefixtures("xcpng_chained")
# FIXME take "uefi" outa here and allow "bios"
@pytest.mark.parametrize("mode", [
"80", "81",
"ch821.1", "xs8",
"821.1",
"821.1-821.1",
"83b2",
"821.1-83b2",
"81-83b2", "80-83b2",
"ch821.1-83b2",
#"83b2-83b2", # 8.3b2 disabled the upgrade from 8.3
"821.1-83b2-83b2",
Expand Down Expand Up @@ -188,6 +193,8 @@ def test_firstboot(self, firmware, request, create_vms, mode):
expected_rel = {
"ch821.1": "8.2.1",
"xs8": "8.4.0",
"80": "8.0.0",
"81": "8.1.0",
"821.1": "8.2.1",
"83b2": "8.3.0",
}[expected_rel_id]
Expand Down Expand Up @@ -241,21 +248,45 @@ def test_firstboot(self, firmware, request, create_vms, mode):
# wait for XAPI
wait_for(pool.master.is_enabled, "Wait for XAPI to be ready", timeout_secs=30 * 60)

# check for firstboot issues
# FIXME: flaky, must check logs extraction on failure
for service in ["control-domain-params-init",
if lsb_rel in ["8.2.1", "8.3.0", "8.4.0"]:
SERVICES =["control-domain-params-init",
"network-init",
"storage-init",
"generate-iscsi-iqn",
"create-guest-templates",
]:
try:
wait_for(lambda: pool.master.ssh(["test", "-e", f"/var/lib/misc/ran-{service}"],
]
STAMPS_DIR = "/var/lib/misc"
STAMPS = [f"ran-{service}" for service in SERVICES]
elif lsb_rel in ["8.0.0", "8.1.0"]:
SERVICES = ["xs-firstboot"]
STAMPS_DIR = "/etc/firstboot.d/state"
STAMPS = [
"05-prepare-networking",
"10-prepare-storage",
"15-set-default-storage",
"20-udev-storage",
"25-multipath",
"40-generate-iscsi-iqn",
"50-prepare-control-domain-params",
"60-import-keys",
"60-upgrade-likewise-to-pbis",
"62-create-guest-templates",
"80-common-criteria",
"90-flush-pool-db",
"95-legacy-logrotate",
"99-remove-firstboot-flag",
]
# check for firstboot issues
# FIXME: flaky, must check logs extraction on failure
try:
for stamp in STAMPS:
wait_for(lambda: pool.master.ssh(["test", "-e", f"{STAMPS_DIR}/{stamp}"],
check=False, simple_output=False,
).returncode == 0,
f"Wait for ran-{service} stamp")
except TimeoutError:
logging.warning("investigating lack of ran-{service} stamp")
f"Wait for {stamp} stamp")
except TimeoutError:
logging.warning("investigating lack of {stamp} service stamp")
for service in SERVICES:
out = pool.master.ssh(["systemctl", "status", service], check=False)
logging.warning("service status: %s", out)
out = pool.master.ssh(["grep", "-r", service, "/var/log"], check=False)
Expand Down Expand Up @@ -298,6 +329,8 @@ def test_firstboot(self, firmware, request, create_vms, mode):
@pytest.mark.usefixtures("xcpng_chained")
@pytest.mark.parametrize(("orig_version", "iso_version"), [
("821.1", "821.1"),
("80", "83b2"),
("81", "83b2"),
("ch821.1", "83b2"),
("821.1", "83b2"),
#("83b2", "83b2"), # 8.3b2 disabled the upgrade from 8.3
Expand Down

0 comments on commit 1fb21bb

Please sign in to comment.