Skip to content

Commit

Permalink
kola/testiso: set the VM's ram to value of '--qemu-memory' when provided
Browse files Browse the repository at this point in the history
Currently `testiso` only uses 4Gb and ignores `--qemu-memory`, which leads
to a failure when testing new live-images with `/root.erofs`:
```
[    2.133469] dracut-cmdline[536]: /usr/sbin/initqueue: line 65: echo: write error: No space left on device
```

With this PR it's now possible to override default settings:
```
$ cosa kola testiso pxe* --pxe-append-rootfs --qemu-memory 8192
Running test: pxe-offline-install.bios
PASS: pxe-offline-install.bios (1m27.545s)
...
```
  • Loading branch information
nikita-dubrovskii committed Feb 12, 2025
1 parent a7cd4f0 commit 8ebefbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"io"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -391,6 +392,14 @@ func newBaseQemuBuilder(outdir string) (*platform.QemuBuilder, error) {
builder.ConsoleFile = filepath.Join(outdir, "console.txt")
}

if kola.QEMUOptions.Memory != "" {
parsedMem, err := strconv.ParseInt(kola.QEMUOptions.Memory, 10, 32)
if err != nil {
return nil, err
}
builder.MemoryMiB = int(parsedMem)
}

return builder, nil
}

Expand Down

0 comments on commit 8ebefbe

Please sign in to comment.