mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
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 <bbaude@redhat.com>
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ func TestMain(m *testing.M) {
|
||||
|
||||
const (
|
||||
defaultStream = machine.Testing
|
||||
defaultDiskSize uint = 11
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user