From b62fd4cc8a834062af568d27ae887f7b1b59ef7a Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Nov 2026 18:18:28 -0300 Subject: [PATCH] test(xcat-core): genesis_openembedded_duid.t fails on a second enabled unit genesis_openembedded_duid.t fails in the unit suite. The xcat-genesis-network recipe enables xcat-genesis-duid.service and xcat-genesis-bootnic.service, and the test matched SYSTEMD_SERVICE against a list that holds the first unit alone. The test now reads SYSTEMD_SERVICE as a list and asserts that it holds xcat-genesis-duid.service. With that unit removed from the recipe the assertion fails, and with the recipe as it is the test passes. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/genesis_openembedded_duid.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-test/unit/genesis_openembedded_duid.t b/xCAT-test/unit/genesis_openembedded_duid.t index bf64fb2f9e..0147c4962d 100644 --- a/xCAT-test/unit/genesis_openembedded_duid.t +++ b/xCAT-test/unit/genesis_openembedded_duid.t @@ -46,8 +46,11 @@ like( $service_contents, qr/^Type=oneshot$/m, 'the client identifier is written once per boot' ); my $recipe_contents = contents_of("$NETWORK/xcat-genesis-network_1.0.bb"); -like( $recipe_contents, qr/^SYSTEMD_SERVICE:\$\{PN\} = "xcat-genesis-duid\.service"$/m, - 'the recipe enables the client identifier service' ); +# The recipe enables more than one unit, so the list is read as a list. +my ($enabled) = $recipe_contents =~ /^SYSTEMD_SERVICE:\$\{PN\} = "([^"]*)"$/m; +my %enabled = map { $_ => 1 } split( ' ', $enabled // '' ); +ok( $enabled{'xcat-genesis-duid.service'}, 'the recipe enables the client identifier service' ) + or diag( 'SYSTEMD_SERVICE: ' . ( $enabled // 'absent' ) ); like( $recipe_contents, qr{\$\{D\}\$\{libexecdir\}/xcat/genesis-duid$}m, 'the recipe installs the client identifier script' );