mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00

Rename all files to _test.go and rename the package to e2e_test. This makes the linter less strict about things like dot imports. Add some unused nolint directives to silence some warnings, these can be used to find untested options so someone could add tests for them. Fixes #14996 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
44 lines
806 B
Go
44 lines
806 B
Go
package e2e_test
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
type setMachine struct {
|
|
cpus *uint
|
|
diskSize *uint
|
|
memory *uint
|
|
|
|
cmd []string
|
|
}
|
|
|
|
func (i *setMachine) buildCmd(m *machineTestBuilder) []string {
|
|
cmd := []string{"machine", "set"}
|
|
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)))
|
|
}
|
|
if i.memory != nil {
|
|
cmd = append(cmd, "--memory", strconv.Itoa(int(*i.memory)))
|
|
}
|
|
cmd = append(cmd, m.name)
|
|
i.cmd = cmd
|
|
return cmd
|
|
}
|
|
|
|
func (i *setMachine) withCPUs(num uint) *setMachine {
|
|
i.cpus = &num
|
|
return i
|
|
}
|
|
func (i *setMachine) withDiskSize(size uint) *setMachine {
|
|
i.diskSize = &size
|
|
return i
|
|
}
|
|
|
|
func (i *setMachine) withMemory(num uint) *setMachine {
|
|
i.memory = &num
|
|
return i
|
|
}
|