Skip to content

fix(xcat-core): the diskless flat case clears the machine type on riscv64 - #7838

Merged
dhilst merged 6 commits into
xcat2:masterfrom
VersatusHPC:fix/riscv64-diskless-flat-machine-type
Sep 17, 2026
Merged

dhilst merged 6 commits into
xcat2:masterfrom
VersatusHPC:fix/riscv64-diskless-flat-machine-type

Conversation

@dhilst

@dhilst dhilst commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

reg_linux_diskless_installation_flat fails on an EL 10 riscv64 compute node after the node
provisions correctly. The check vmothersetting contains machine fails and lsdef shows the
attribute empty. The case corrupts the KVM machine type, checks that the node does not boot, and
restores it, but the restore reads str3 from a ladder that names ppc64 and x86_64 only. On
riscv64 str3 is empty, chdef writes an empty vmothersetting, and the later comparison ends
with unary operator expected. Both ladders gain a riscv64 arm.
diskless_flat_vmothersetting_machine.t fails five of fifteen assertions without the change.

…scv64

reg_linux_diskless_installation_flat corrupts the KVM machine type of the compute node, checks
that the node does not boot, and restores it. The restore picks the machine type from a ladder
that names ppc64 and x86_64 only. On any other architecture str3 stays empty, so chdef writes an
empty vmothersetting and the check that follows it, "vmothersetting contains machine", fails. The
remove path reads the same ladder and compares against an empty string, which bash reports as
"unary operator expected".

diskless_flat_vmothersetting_machine.t lifts both commands out of the case file and runs them with
lsdef and chdef shadowed, so the assertions read the value the case would write. It fails five of
fifteen assertions, all of them riscv64.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
…cv64

reg_linux_diskless_installation_flat fails on an EL 10 riscv64 compute node after the node has
provisioned correctly. The check that fails is "vmothersetting contains machine", and lsdef shows
the attribute empty.

The case corrupts the KVM machine type, checks that the node does not boot, and restores it. The
restore reads str3 from a ladder that names ppc64 and x86_64 only, so on riscv64 str3 is empty and
chdef writes an empty vmothersetting. The remove path later compares str1 against that same empty
str3, which bash reports as "unary operator expected".

Both ladders gain a riscv64 arm giving machine:virt, the machine a riscv64 guest runs and the one
guest_arch_profile in kvm.pm sets. The two comparisons now quote their operands, so an empty value
compares instead of ending the command.

diskless_flat_vmothersetting_machine.t fails five of fifteen assertions without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
…he whole suite

diskless_flat_vmothersetting_machine.t called BAIL_OUT at four places
where it could not read or match the case file. prove stops every
remaining file on a bail-out, so an edit to the case that breaks a regex
in this file also hides every test that would have run after it. die is
just as loud and costs only this file.

The header also traced the empty vmothersetting out to the red cell. What
the reader needs is the ladder that names two architectures.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
diskless_flat_vmothersetting_machine.t measures shell. It lifts two commands
out of reg_linux_diskless_installation_flat, renders the xcattest placeholders,
writes a wrapper that shadows lsdef and chdef, and shells out. The Perl adds
nothing the shell cannot state, and the case file it reads is shell itself.

The test moves to xCAT-test/bats, which the xcat_test workflow already runs. It
keeps what it proved: on ppc64le, x86_64 and riscv64 the restore writes a
machine type rather than an empty vmothersetting, the check that follows it
passes, and the remove path compares two defined strings. A command that stops
matching fails the test instead of covering nothing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
@viniciusferrao
viniciusferrao self-requested a review September 16, 2026 22:42
@viniciusferrao viniciusferrao added this to the 2.19 milestone Sep 16, 2026

@viniciusferrao viniciusferrao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhilst do you think that it's a good idea the BATS test also check what
chdef receives after cleanup? With only machine:virt, it should
write an empty value; with other settings present, those should stay.
Currently it only checks for the absence of unary operator expected,
so a cleanup that leaves the machine setting behind still passes.

If don't just dismiss my review and merge it.

… nothing

diskless_flat_vmothersetting_machine.bats checked the restore with a substring
match and checked the cleanup only for the absence of "unary operator
expected". A cleanup that writes the machine type back, or leaves it in place,
passed both.

The test now reads the value chdef receives. The restore must write exactly
machine:<type>, and must keep a setting the node already carries. The cleanup
must write an empty value when the machine type is all there is, and must leave
the other setting behind when there is one. The chdef stub brackets its
arguments so an empty value is not the same as no call.

ppc64le is red on the cleanup: the restore ladder writes
machine:pseries-rhel7.6.0 and the cleanup ladder removes machine:pseries-7.6.0,
so the node keeps the machine type. x86_64 and riscv64 pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
…ppc64

reg_linux_diskless_installation_flat corrupts the KVM machine type, proves the
node fails to boot, restores the machine type and then removes it again. On
ppc64 the two ladders name different machine types: the restore writes
machine:pseries-rhel7.6.0 and the cleanup removes machine:pseries-7.6.0. The sed
matches nothing, so the node keeps machine:pseries-rhel7.6.0 after the case ends
and the next case runs against a node the previous one changed.

The cleanup ladder now names the machine type the restore ladder writes.

diskless_flat_vmothersetting_machine.bats covers it: the ppc64le cleanup cases
are red on the commit before this one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
@dhilst dhilst modified the milestones: 2.19, 2.19.1 Sep 17, 2026
@dhilst
dhilst enabled auto-merge September 17, 2026 21:12

@viniciusferrao viniciusferrao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dhilst
dhilst merged commit 52fd332 into xcat2:master Sep 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants