Skip to content

Commit 1fb21bb

Browse files
committed
WIP install: add installation of xcp-ng 8.0 and 8.1, upgrades to 8.3b2
FIXME: - firstboot handling is different from 8.2+
1 parent d1b11d6 commit 1fb21bb

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

data.py-dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ VM_IMAGES = {
4747

4848
# FIXME: use URLs and an optional cache?
4949
ISO_IMAGES = {
50+
# 'xcpng-8.0': "/home/user/iso/xcp-ng-8.0.0.iso",
51+
# 'xcpng-8.1': "/home/user/iso/xcp-ng-8.1.0-2.iso",
5052
# 'xcpng-8.2.0': "/home/user/iso/xcp-ng-8.2.0.iso",
5153
# 'xcpng-8.2.1': "/home/user/iso/xcp-ng-8.2.1.iso",
5254
# 'xcpng-8.2.1-2023': "/home/user/iso/xcp-ng-8.2.1-20231130.iso",

tests/install/test.py

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
@pytest.mark.dependency()
1818
class TestNested:
1919
@pytest.mark.parametrize("iso_version", (
20+
"80", "81",
2021
"ch821.1", "xs8",
2122
"821.1", "83b2",
2223
))
2324
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
2425
@pytest.mark.installer_iso(
2526
lambda version: {
27+
"80": "xcpng-8.0",
28+
"81": "xcpng-8.1",
2629
"821.1": "xcpng-8.2.1-2023",
2730
"83b2": "xcpng-8.3-beta2",
2831
"ch821.1": "ch-8.2.1-23",
@@ -144,11 +147,13 @@ def test_install(self, request, firmware, iso_version, iso_remaster, create_vms)
144147
@pytest.mark.usefixtures("xcpng_chained")
145148
# FIXME take "uefi" outa here and allow "bios"
146149
@pytest.mark.parametrize("mode", [
150+
"80", "81",
147151
"ch821.1", "xs8",
148152
"821.1",
149153
"821.1-821.1",
150154
"83b2",
151155
"821.1-83b2",
156+
"81-83b2", "80-83b2",
152157
"ch821.1-83b2",
153158
#"83b2-83b2", # 8.3b2 disabled the upgrade from 8.3
154159
"821.1-83b2-83b2",
@@ -188,6 +193,8 @@ def test_firstboot(self, firmware, request, create_vms, mode):
188193
expected_rel = {
189194
"ch821.1": "8.2.1",
190195
"xs8": "8.4.0",
196+
"80": "8.0.0",
197+
"81": "8.1.0",
191198
"821.1": "8.2.1",
192199
"83b2": "8.3.0",
193200
}[expected_rel_id]
@@ -241,21 +248,45 @@ def test_firstboot(self, firmware, request, create_vms, mode):
241248
# wait for XAPI
242249
wait_for(pool.master.is_enabled, "Wait for XAPI to be ready", timeout_secs=30 * 60)
243250

244-
# check for firstboot issues
245-
# FIXME: flaky, must check logs extraction on failure
246-
for service in ["control-domain-params-init",
251+
if lsb_rel in ["8.2.1", "8.3.0", "8.4.0"]:
252+
SERVICES =["control-domain-params-init",
247253
"network-init",
248254
"storage-init",
249255
"generate-iscsi-iqn",
250256
"create-guest-templates",
251-
]:
252-
try:
253-
wait_for(lambda: pool.master.ssh(["test", "-e", f"/var/lib/misc/ran-{service}"],
257+
]
258+
STAMPS_DIR = "/var/lib/misc"
259+
STAMPS = [f"ran-{service}" for service in SERVICES]
260+
elif lsb_rel in ["8.0.0", "8.1.0"]:
261+
SERVICES = ["xs-firstboot"]
262+
STAMPS_DIR = "/etc/firstboot.d/state"
263+
STAMPS = [
264+
"05-prepare-networking",
265+
"10-prepare-storage",
266+
"15-set-default-storage",
267+
"20-udev-storage",
268+
"25-multipath",
269+
"40-generate-iscsi-iqn",
270+
"50-prepare-control-domain-params",
271+
"60-import-keys",
272+
"60-upgrade-likewise-to-pbis",
273+
"62-create-guest-templates",
274+
"80-common-criteria",
275+
"90-flush-pool-db",
276+
"95-legacy-logrotate",
277+
"99-remove-firstboot-flag",
278+
]
279+
# check for firstboot issues
280+
# FIXME: flaky, must check logs extraction on failure
281+
try:
282+
for stamp in STAMPS:
283+
wait_for(lambda: pool.master.ssh(["test", "-e", f"{STAMPS_DIR}/{stamp}"],
254284
check=False, simple_output=False,
255285
).returncode == 0,
256-
f"Wait for ran-{service} stamp")
257-
except TimeoutError:
258-
logging.warning("investigating lack of ran-{service} stamp")
286+
f"Wait for {stamp} stamp")
287+
except TimeoutError:
288+
logging.warning("investigating lack of {stamp} service stamp")
289+
for service in SERVICES:
259290
out = pool.master.ssh(["systemctl", "status", service], check=False)
260291
logging.warning("service status: %s", out)
261292
out = pool.master.ssh(["grep", "-r", service, "/var/log"], check=False)
@@ -298,6 +329,8 @@ def test_firstboot(self, firmware, request, create_vms, mode):
298329
@pytest.mark.usefixtures("xcpng_chained")
299330
@pytest.mark.parametrize(("orig_version", "iso_version"), [
300331
("821.1", "821.1"),
332+
("80", "83b2"),
333+
("81", "83b2"),
301334
("ch821.1", "83b2"),
302335
("821.1", "83b2"),
303336
#("83b2", "83b2"), # 8.3b2 disabled the upgrade from 8.3

0 commit comments

Comments
 (0)