fix(xcat-core): the diskless flat case clears the machine type on riscv64 - #7838
Merged
dhilst merged 6 commits intoSep 17, 2026
Merged
Conversation
…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
requested changes
Sep 16, 2026
viniciusferrao
left a comment
Member
There was a problem hiding this comment.
@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
enabled auto-merge
September 17, 2026 21:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reg_linux_diskless_installation_flatfails on an EL 10 riscv64 compute node after the nodeprovisions correctly. The check
vmothersetting contains machinefails andlsdefshows theattribute empty. The case corrupts the KVM machine type, checks that the node does not boot, and
restores it, but the restore reads
str3from a ladder that names ppc64 and x86_64 only. Onriscv64
str3is empty,chdefwrites an emptyvmothersetting, and the later comparison endswith
unary operator expected. Both ladders gain a riscv64 arm.diskless_flat_vmothersetting_machine.tfails five of fifteen assertions without the change.