mirror of
https://github.com/containers/podman.git
synced 2025-10-30 01:17:00 +08:00
This PR introduces a test suite for podman machine. It can currently be run on developers' local machines and is not part of the official CI testing; however, the expectation is that any work on machine should come with an accompanying test. At present, the test must be run on Linux. It is untested on Darwin. There is no Makefile target for the test. It can be run like `ginkgo -v pkg/machine/test/.`. It should be run as a unprivileged user. Signed-off-by: Brent Baude <bbaude@redhat.com>
34 lines
605 B
Go
34 lines
605 B
Go
package e2e
|
|
|
|
type sshMachine struct {
|
|
/*
|
|
--username string Username to use when ssh-ing into the VM.
|
|
*/
|
|
|
|
username string
|
|
sshCommand []string
|
|
|
|
cmd []string
|
|
}
|
|
|
|
func (s sshMachine) buildCmd(m *machineTestBuilder) []string {
|
|
cmd := []string{"machine", "ssh"}
|
|
if len(m.name) > 0 {
|
|
cmd = append(cmd, m.name)
|
|
}
|
|
if len(s.sshCommand) > 0 {
|
|
cmd = append(cmd, s.sshCommand...)
|
|
}
|
|
return cmd
|
|
}
|
|
|
|
func (s *sshMachine) withUsername(name string) *sshMachine {
|
|
s.username = name
|
|
return s
|
|
}
|
|
|
|
func (s *sshMachine) withSSHComand(sshCommand []string) *sshMachine {
|
|
s.sshCommand = sshCommand
|
|
return s
|
|
}
|