mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-16 04:37:52 +00:00
Plus manually deleting the left over inline functions because go fix doesn't do that even though they are private functions. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
47 lines
908 B
Go
47 lines
908 B
Go
package e2e_test
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
)
|
|
|
|
type startMachine struct {
|
|
/*
|
|
No command line args other than a machine vm name (also not required)
|
|
*/
|
|
quiet bool
|
|
noInfo bool
|
|
updateConnection *bool
|
|
}
|
|
|
|
func (s *startMachine) buildCmd(m *machineTestBuilder) []string {
|
|
cmd := []string{"machine", "start"}
|
|
if len(m.name) > 0 {
|
|
cmd = append(cmd, m.name)
|
|
}
|
|
if s.quiet {
|
|
cmd = append(cmd, "--quiet")
|
|
}
|
|
if s.noInfo {
|
|
cmd = append(cmd, "--no-info")
|
|
}
|
|
if s.updateConnection != nil {
|
|
cmd = append(cmd, fmt.Sprintf("--update-connection=%s", strconv.FormatBool(*s.updateConnection)))
|
|
}
|
|
return cmd
|
|
}
|
|
|
|
func (s *startMachine) withQuiet() *startMachine {
|
|
s.quiet = true
|
|
return s
|
|
}
|
|
|
|
func (s *startMachine) withNoInfo() *startMachine {
|
|
s.noInfo = true
|
|
return s
|
|
}
|
|
|
|
func (s *startMachine) withUpdateConnection(value *bool) *startMachine {
|
|
s.updateConnection = value
|
|
return s
|
|
}
|