From 446df4379f1cbd600d0c30b58b901a2d38b35ea6 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Wed, 13 Dec 2023 08:52:45 -0600 Subject: [PATCH] machine e2e : set default disk size to 11 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 --- pkg/machine/e2e/config_init_test.go | 4 +++- pkg/machine/e2e/machine_test.go | 3 ++- pkg/machine/e2e/set_test.go | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/machine/e2e/config_init_test.go b/pkg/machine/e2e/config_init_test.go index c0c2b1c89f..c82951b1a8 100644 --- a/pkg/machine/e2e/config_init_test.go +++ b/pkg/machine/e2e/config_init_test.go @@ -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) } diff --git a/pkg/machine/e2e/machine_test.go b/pkg/machine/e2e/machine_test.go index ae89e839a3..5c2a0f30db 100644 --- a/pkg/machine/e2e/machine_test.go +++ b/pkg/machine/e2e/machine_test.go @@ -25,7 +25,8 @@ func TestMain(m *testing.M) { } const ( - defaultStream = machine.Testing + defaultStream = machine.Testing + defaultDiskSize uint = 11 ) var ( diff --git a/pkg/machine/e2e/set_test.go b/pkg/machine/e2e/set_test.go index 38541de049..a7f7602d77 100644 --- a/pkg/machine/e2e/set_test.go +++ b/pkg/machine/e2e/set_test.go @@ -1,6 +1,7 @@ package e2e_test import ( + "fmt" "runtime" "strconv" "strings" @@ -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() {