From ae2ccc81885e56db6812138176ba4d15fd051f28 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 12 Nov 2026 12:21:14 -0300 Subject: [PATCH] test(xcat-core): bmcsetup reports failed for a dotted-decimal BMC IPv6 address An IPv6 address can end in dotted decimal: 2001:db8:1::192.0.2.20 and 2001:db8:1::c000:214 are the same address. ipmitool and BMCUtils accept the dotted form, but ipv6_expand in bmcsetup rejects the dots, so an OpenBMC configured with that spelling reports installstatus failed. The new cases check the final OpenBMC status for both spellings, in both directions, and for a different address. The first case fails on the current bmcsetup. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/bats/genesis_bmcsetup_users.bats | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/xCAT-test/bats/genesis_bmcsetup_users.bats b/xCAT-test/bats/genesis_bmcsetup_users.bats index e340d9c581..8baeba63f1 100644 --- a/xCAT-test/bats/genesis_bmcsetup_users.bats +++ b/xCAT-test/bats/genesis_bmcsetup_users.bats @@ -521,6 +521,35 @@ LAN CASES } +@test 'bmcsetup reports an OpenBMC ready for a dotted-decimal spelling of its IPv6 address' { + local configured readback + while read -r configured readback; do + run openbmc_status "$configured" "$readback" + [ "$status" -eq 0 ] + [ "$output" = '2001:db8::1 3002 installstatus bmcready' ] || { + echo "$configured read back as $readback: $output"; return 1; } + done <<'CASES' +2001:db8:1::192.0.2.20 2001:db8:1::c000:214/64 +2001:db8:1::c000:214 2001:db8:1::192.0.2.20/64 +2001:db8:1::192.0.2.20 2001:db8:1::192.0.2.20/64 +::ffff:192.0.2.20 ::ffff:c000:214 +CASES +} + +@test 'bmcsetup reports an OpenBMC failed for a different dotted-decimal IPv6 address' { + local configured readback + while read -r configured readback; do + run openbmc_status "$configured" "$readback" + [ "$status" -eq 0 ] + [ "$output" = '2001:db8::1 3002 installstatus failed' ] || { + echo "$configured read back as $readback: $output"; return 1; } + done <<'CASES' +2001:db8:1::192.0.2.20 2001:db8:1::c000:215/64 +2001:db8:1::c000:214 2001:db8:1::192.0.2.21/64 +2001:db8:1::c000:214 2001:db8:1::192.0.2.276/64 +CASES +} + @test 'bmcsetup reports an OpenBMC failed for an IPv6 address that only shares a text prefix' { local configured readback while read -r configured readback; do