Skip to content

Commit

Permalink
machine e2e : set default disk size to 11
Browse files Browse the repository at this point in the history
this default value for podman machine disk sizes is 100GB.  On CI
platforms where the IO is slow and some operations are not done
sparsely, this can really slow things down.

if no disk size is provided by the init command in the test suite, we
set it to 11G.

Signed-off-by: Brent Baude <[email protected]>
  • Loading branch information
baude committed Dec 13, 2023
1 parent 4582b61 commit 446df43
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/machine/e2e/config_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ type initMachine struct {
}

func (i *initMachine) buildCmd(m *machineTestBuilder) []string {
diskSize := defaultDiskSize
cmd := []string{"machine", "init"}
if i.cpus != nil {
cmd = append(cmd, "--cpus", strconv.Itoa(int(*i.cpus)))
}
if i.diskSize != nil {
cmd = append(cmd, "--disk-size", strconv.Itoa(int(*i.diskSize)))
diskSize = *i.diskSize
}
cmd = append(cmd, "--disk-size", strconv.Itoa(int(diskSize)))
if l := len(i.ignitionPath); l > 0 {
cmd = append(cmd, "--ignition-path", i.ignitionPath)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/machine/e2e/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func TestMain(m *testing.M) {
}

const (
defaultStream = machine.Testing
defaultStream = machine.Testing
defaultDiskSize uint = 11
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/machine/e2e/set_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package e2e_test

import (
"fmt"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -131,7 +132,7 @@ var _ = Describe("podman machine set", func() {
sshSession3, err := mb.setName(name).setCmd(ssh3.withSSHCommand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
Expect(err).ToNot(HaveOccurred())
Expect(sshSession3).To(Exit(0))
Expect(sshSession3.outputToString()).To(ContainSubstring("100 GiB"))
Expect(sshSession3.outputToString()).To(ContainSubstring(fmt.Sprintf("%d GiB", defaultDiskSize)))
})

It("set rootful with docker sock change", func() {
Expand Down

0 comments on commit 446df43

Please sign in to comment.