Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for ppc64le boot mirroring tests #3611

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,7 @@ ExecStart=%s

// Architectures using 64k pages use slightly more memory, ask for more than requested
// to make sure that we don't run out of it. Currently ppc64le and aarch64 use 64k pages.
// See similar logic in boot-mirror.go and luks.go.
switch coreosarch.CurrentRpmArch() {
case "ppc64le", "aarch64":
if targetMeta.MinMemory <= 4096 {
Expand Down
2 changes: 1 addition & 1 deletion mantle/kola/tests/ignition/luks.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func runTest(c cluster.TestCluster, tpm2 bool, threshold int, killTangAfterFirst
opts := platform.MachineOptions{
MinMemory: 4096,
}
// ppc64le and aarch64 use 64K pages
// ppc64le and aarch64 use 64K pages; see similar logic in harness.go and boot-mirror.go
switch coreosarch.CurrentRpmArch() {
case "ppc64le", "aarch64":
opts.MinMemory = 8192
Expand Down
17 changes: 17 additions & 0 deletions mantle/kola/tests/misc/boot-mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func runBootMirrorTest(c cluster.TestCluster) {
MinMemory: 4096,
},
}
// ppc64le and aarch64 use 64K pages; see similar logic in harness.go and luks.go
switch coreosarch.CurrentRpmArch() {
case "ppc64le", "aarch64":
options.MinMemory = 8192
}
// FIXME: for QEMU tests kola currently assumes the host CPU architecture
// matches the one under test
userdata := bootmirror.Subst("LAYOUT", coreosarch.CurrentRpmArch())
Expand Down Expand Up @@ -147,6 +152,11 @@ func runBootMirrorLUKSTest(c cluster.TestCluster) {
MinMemory: 4096,
},
}
// ppc64le and aarch64 use 64K pages; see similar logic in harness.go and luks.go
switch coreosarch.CurrentRpmArch() {
case "ppc64le", "aarch64":
options.MinMemory = 8192
}
// FIXME: for QEMU tests kola currently assumes the host CPU architecture
// matches the one under test
userdata := bootmirrorluks.Subst("LAYOUT", coreosarch.CurrentRpmArch())
Expand Down Expand Up @@ -230,6 +240,13 @@ func detachPrimaryBlockDevice(c cluster.TestCluster, m platform.Machine) {
}); err != nil {
c.Fatalf("Failed to retrieve boot ID: %v", err)
}

// Give some time to the host before doing the reboot. Without it, we've noticed
// that rebooting too quickly after ripping out the primary device can trigger
// a kernel panic on ppc64le. This may be memory-related since the same panic
// happens more easily if memory is lowered to 4G.
time.Sleep(30 * time.Second)

err := m.Reboot()
if err != nil {
c.Fatalf("Failed to reboot the machine: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ func (inst *QemuInstance) SwitchBootOrder() (err2 error) {
}

// RemovePrimaryBlockDevice deletes the primary device from a qemu instance
// and sets the seconday device as primary. It expects that all block devices
// are mirrors.
// and sets the secondary device as primary. It expects that all block devices
// with device name disk-<N> are mirrors.
func (inst *QemuInstance) RemovePrimaryBlockDevice() (err2 error) {
var primaryDevice string
var secondaryDevicePath string
Expand All @@ -397,7 +397,7 @@ func (inst *QemuInstance) RemovePrimaryBlockDevice() (err2 error) {
// a `BackingFileDepth` parameter of a device and check if
// it is a removable and part of `virtio-blk-pci` devices.
for _, dev := range blkdevs.Return {
if !dev.Removable && strings.Contains(dev.DevicePath, "virtio-backend") {
if !dev.Removable && strings.HasPrefix(dev.Device, "disk-") {
if dev.Inserted.BackingFileDepth == 1 {
primaryDevice = dev.DevicePath
} else {
Expand Down Expand Up @@ -1131,7 +1131,7 @@ func (builder *QemuBuilder) addDiskImpl(disk *Disk, primary bool) error {
opts = "," + strings.Join(diskOpts, ",")
}

id := fmt.Sprintf("d%d", builder.diskID)
id := fmt.Sprintf("disk-%d", builder.diskID)

// Avoid file locking detection, and the disks we create
// here are always currently ephemeral.
Expand Down
Loading