From 32dd44efd4a7d9d875dbd779630ec51df8e2c8c2 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 5 Sep 2024 20:51:27 +0200 Subject: [PATCH 1/5] Add temporary post-install jobs Signed-off-by: Samuel Verschelde --- jobs.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/jobs.py b/jobs.py index 36d3f4067..0c6ba3d2b 100755 --- a/jobs.py +++ b/jobs.py @@ -20,6 +20,67 @@ class JobData(TypedDict): name_filter: NotRequired[str] JOBS: dict[str, JobData] = { + "postinstall": { + "description": + "Minimal set of tests to run after an installation or an upgrade.", + "requirements": [ + "A pool master with a local SR. Can be a single-host pool.", + "A second one-host pool with a SR to receive cross-pool migrated VMs.", + "(If you can't provide a second pool, add `-m 'not hostB1'`, and specify the pool master of the first " + "pool twice.) Config in data.py for a NFS SR.", + "A VM (small and fast-booting).", + ], + "nb_pools": 2, + "params": { + "--vm": "single/small_vm", + }, + "paths": [ + "tests/xo/test_xo_connection.py", + "tests/misc", + "tests/system", + ], + "markers": "not hostA2 and (small_vm or no_vm) and not reboot and not complex_prerequisites and not sr_disk", + }, + "postinstall-intrapool-migrate": { + "description": + "Minimal intra-pool live-migrate tests to run after an installation or an upgrade.", + "requirements": [ + "A pool with at least 2 hosts and a shared SR in addition to local SRs on hosts. The shared SR is the " + "default SR of the pool.", + "A VM (small and fast-booting).", + ], + "nb_pools": 1, + "params": { + "--vm": "single/small_vm", + }, + "paths": [ + "tests/misc/test_basic_without_ssh.py::TestBasicNoSSH::test_live_migrate", + ], + }, + "postinstall-with-tls": { + "description": + "Minimal set of tests to run after an installation or an upgrade, and after enabling TLS verification in " + "the case of an upgrade. Includes a pool join test.", + "requirements": [ + "A pool with at least 2 hosts.", + "(If the pool has only one host, you can add `-m 'not hostA2'` parameter but this will skip the TLS " + "verification test.)", + "A second one-host pool, without any shared storage, which will be temporarily joined to the first pool.", + "(If you can't provide a second pool, which is too bad because this skips pool join tests, add " + "`-m 'not hostB1'`, and specify the pool master of the first pool twice.)", + "TLS verification enabled on both pools.", + "A VM (small and fast-booting).", + ], + "nb_pools": 2, + "params": { + "--vm": "single/small_vm", + }, + "paths": [ + "tests/xapi/tls_verification", + # because we want to test a pool join + "tests/uefi_sb/test_varstored_cert_flow.py::TestPoolToDiskCertInheritanceOnPoolJoin", + ], + }, "main": { "description": "a group of not-too-long tests that run either without a VM, or with a single small one", "requirements": [ @@ -28,6 +89,7 @@ class JobData(TypedDict): "An additional free disk on the first host.", "Config in data.py for another NFS SR.", "A VM (small and fast-booting).", + "On XCP-ng 8.3+: TLS verification must be enabled.", ], "nb_pools": 2, "params": { From 5b415d16c5853e116ec587273da7a49a003ef481 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Wed, 18 Sep 2024 10:22:11 +0200 Subject: [PATCH 2/5] fixup: only one pool required for postinstall job Signed-off-by: Samuel Verschelde --- jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs.py b/jobs.py index 0c6ba3d2b..2a12209d3 100755 --- a/jobs.py +++ b/jobs.py @@ -30,7 +30,7 @@ class JobData(TypedDict): "pool twice.) Config in data.py for a NFS SR.", "A VM (small and fast-booting).", ], - "nb_pools": 2, + "nb_pools": 1, "params": { "--vm": "single/small_vm", }, From 579347a99aedecbbe02184cf05d103b2a1fb6ad0 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Wed, 4 Jun 2025 16:04:43 +0200 Subject: [PATCH 3/5] Add firstboot test Signed-off-by: Samuel Verschelde --- tests/xapi/firstboot/__init__.py | 0 tests/xapi/firstboot/test_firstboot.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/xapi/firstboot/__init__.py create mode 100644 tests/xapi/firstboot/test_firstboot.py diff --git a/tests/xapi/firstboot/__init__.py b/tests/xapi/firstboot/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/xapi/firstboot/test_firstboot.py b/tests/xapi/firstboot/test_firstboot.py new file mode 100644 index 000000000..6cf7874e1 --- /dev/null +++ b/tests/xapi/firstboot/test_firstboot.py @@ -0,0 +1,20 @@ +import os + +# Requirements: +# From --hosts parameter: +# - A XCP-ng >= 8.2 host + +FIRSTBOOT_FILES = [ + 'ran-control-domain-params-init', + 'ran-create-guest-templates', + 'ran-generate-iscsi-iqn', + 'ran-network-init', + 'ran-storage-init', +] + +FIRSTBOOT_DIR = '/var/lib/misc' + +def test_firstboot_ran(host): + for name in FIRSTBOOT_FILES: + filepath = os.path.join(FIRSTBOOT_DIR, name) + assert host.file_exists(filepath) From a55dbdd6383afafd609dc3cceb9d53ba9cc5e415 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Wed, 4 Jun 2025 16:30:39 +0200 Subject: [PATCH 4/5] Add firstboot test to postinstall job Signed-off-by: Samuel Verschelde --- jobs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jobs.py b/jobs.py index 2a12209d3..e57ec48f4 100755 --- a/jobs.py +++ b/jobs.py @@ -35,6 +35,7 @@ class JobData(TypedDict): "--vm": "single/small_vm", }, "paths": [ + "tests/xapi/firstboot", "tests/xo/test_xo_connection.py", "tests/misc", "tests/system", From 553e88496d400395917f38b8b9317b9850f8157e Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Tue, 1 Sep 2026 20:34:46 +0200 Subject: [PATCH 5/5] A second one-host pool is not necessary for the postinstall job More specifically it does not include cross-pool migration tests. Signed-off-by: Vincent Michel --- jobs.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/jobs.py b/jobs.py index e57ec48f4..06fc5b5d1 100755 --- a/jobs.py +++ b/jobs.py @@ -25,9 +25,6 @@ class JobData(TypedDict): "Minimal set of tests to run after an installation or an upgrade.", "requirements": [ "A pool master with a local SR. Can be a single-host pool.", - "A second one-host pool with a SR to receive cross-pool migrated VMs.", - "(If you can't provide a second pool, add `-m 'not hostB1'`, and specify the pool master of the first " - "pool twice.) Config in data.py for a NFS SR.", "A VM (small and fast-booting).", ], "nb_pools": 1,