diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-07-21 11:36:32 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-07-26 14:24:30 -0400 |
commit | ce790e61b1a0a983a1900b76b1ad9864d15b1496 (patch) | |
tree | 4c07afe3d699e73ce77ed171342ff58869a24bc4 /pkg/machine/e2e/config_rm_test.go | |
parent | ff7259567663ee5d6cf9b3e8e62c5d4ac39c47d6 (diff) | |
download | podman-ce790e61b1a0a983a1900b76b1ad9864d15b1496.tar.gz podman-ce790e61b1a0a983a1900b76b1ad9864d15b1496.tar.bz2 podman-ce790e61b1a0a983a1900b76b1ad9864d15b1496.zip |
enable linter for pkg/machine/e2e
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>
Diffstat (limited to 'pkg/machine/e2e/config_rm_test.go')
-rw-r--r-- | pkg/machine/e2e/config_rm_test.go | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/machine/e2e/config_rm_test.go b/pkg/machine/e2e/config_rm_test.go new file mode 100644 index 000000000..1f9c9b4ec --- /dev/null +++ b/pkg/machine/e2e/config_rm_test.go @@ -0,0 +1,56 @@ +package e2e_test + +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 { //nolint:unused + i.saveIgnition = true + return i +} + +func (i *rmMachine) withSaveImage() *rmMachine { //nolint:unused + i.saveImage = true + return i +} + +func (i *rmMachine) withSaveKeys() *rmMachine { //nolint:unused + i.saveKeys = true + return i +} |