build-usb: --site-vars puts the per-site vars on CIDATA; harness pins the VM NIC MACs

tests/vm/build-image.sh writes site-vars.yml with pxe_nic_mac (isolated
network NIC) and corp_nic_mac (NAT NIC) and passes it to build-usb.sh.
This commit is contained in:
cproudlock
2026-10-15 08:56:45 -04:00
parent 29d815fbeb
commit 6dc9761e67
4 changed files with 43 additions and 5 deletions

View File

@@ -41,7 +41,18 @@ if [ -e "$USB_IMAGE" ] && [ ! -f "$USB_IMAGE" ]; then
die "$USB_IMAGE is not a regular file"
fi
# Site vars for the VM "site": pin the NICs by the fixed MACs from common.sh.
SITE_VARS="$PXETEST_CACHE/site-vars.yml"
cat >"$SITE_VARS" <<YML
---
# Generated by tests/vm/build-image.sh for the pxetest VMs.
pxe_nic_mac: "$SERVER_IMAGING_MAC" # pxetest-imaging (isolated)
corp_nic_mac: "$SERVER_GE_MAC" # libvirt default NAT ("GE/corp")
YML
log "site vars: pxe_nic_mac=$SERVER_IMAGING_MAC corp_nic_mac=$SERVER_GE_MAC"
"$REPO_ROOT/scripts/build-usb.sh" --yes --payload-root "$PXETEST_PAYLOAD_ROOT" \
--site-vars "$SITE_VARS" \
"${ARGS[@]}" --image "$USB_IMAGE" "$SIZE" "$UBUNTU_ISO"
BYTES=$(stat -c%s "$USB_IMAGE")