Files
podman/pkg/machine/e2e/config_cp_test.go
Jake Correnti 42fb942a6f Introduce podman machine cp command
Add a new `podman machine cp` subcommand to allow users to copy files or
directories between a running Podman Machine and their host.

Tests cover the following cases:
- Copy a file from the host machine to the VM
- Copy a directory from the host machine to the VM
- Copy a file from the VM to the host machine
- Copy a directory from the VM to the host machine
- Copy a file to a directory
- Copy a directory to a file

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:56:46 -05:00

38 lines
545 B
Go

package e2e_test
type cpMachine struct {
quiet bool
src string
dest string
cmd []string
}
func (c *cpMachine) buildCmd(m *machineTestBuilder) []string {
cmd := []string{"machine", "cp"}
if c.quiet {
cmd = append(cmd, "--quiet")
}
cmd = append(cmd, c.src, c.dest)
c.cmd = cmd
return cmd
}
func (c *cpMachine) withQuiet() *cpMachine {
c.quiet = true
return c
}
func (c *cpMachine) withSrc(src string) *cpMachine {
c.src = src
return c
}
func (c *cpMachine) withDest(dest string) *cpMachine {
c.dest = dest
return c
}