summaryrefslogtreecommitdiff
path: root/pkg/machine/e2e/config_rm.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-25 16:36:01 -0400
committerGitHub <noreply@github.com>2022-04-25 16:36:01 -0400
commit05bdb4139a02eb35220c23b8ae8fe355f6d91406 (patch)
tree59e3b673f018d25dde266b158c6b799c65c603f6 /pkg/machine/e2e/config_rm.go
parent181c9d3ee3ad4820b9ae91f1f02faf7b9e65fc87 (diff)
parent833456e079c31111a15fedaa3ccd7f852e89e508 (diff)
downloadpodman-05bdb4139a02eb35220c23b8ae8fe355f6d91406.tar.gz
podman-05bdb4139a02eb35220c23b8ae8fe355f6d91406.tar.bz2
podman-05bdb4139a02eb35220c23b8ae8fe355f6d91406.zip
Merge pull request #13942 from baude/machinetests
Add podman machine test suite
Diffstat (limited to 'pkg/machine/e2e/config_rm.go')
-rw-r--r--pkg/machine/e2e/config_rm.go56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/machine/e2e/config_rm.go b/pkg/machine/e2e/config_rm.go
new file mode 100644
index 000000000..6cf262a22
--- /dev/null
+++ b/pkg/machine/e2e/config_rm.go
@@ -0,0 +1,56 @@
+package e2e
+
+type rmMachine struct {
+ /*
+ -f, --force Stop and do not prompt before rming
+ --save-ignition Do not delete ignition file
+ --save-image Do not delete the image file
+ --save-keys Do not delete SSH keys
+
+ */
+ force bool
+ saveIgnition bool
+ saveImage bool
+ saveKeys bool
+
+ cmd []string
+}
+
+func (i *rmMachine) buildCmd(m *machineTestBuilder) []string {
+ cmd := []string{"machine", "rm"}
+ if i.force {
+ cmd = append(cmd, "--force")
+ }
+ if i.saveIgnition {
+ cmd = append(cmd, "--save-ignition")
+ }
+ if i.saveImage {
+ cmd = append(cmd, "--save-image")
+ }
+ if i.saveKeys {
+ cmd = append(cmd, "--save-keys")
+ }
+ cmd = append(cmd, m.name)
+ i.cmd = cmd
+ return cmd
+}
+
+func (i *rmMachine) withForce() *rmMachine {
+ i.force = true
+ return i
+}
+
+func (i *rmMachine) withSaveIgnition() *rmMachine {
+ i.saveIgnition = true
+ return i
+}
+
+func (i *rmMachine) withSaveImage() *rmMachine {
+ i.saveImage = true
+ return i
+}
+
+func (i *rmMachine) withSaveKeys() *rmMachine {
+ i.saveKeys = true
+ return i
+}