summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/common_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-29 04:56:31 -0400
committerGitHub <noreply@github.com>2020-06-29 04:56:31 -0400
commit3022d70285c2de2f6819a1637a06751d329eb751 (patch)
treeebd8c289e6e0e8db368c1655de0288ccd7f74b49 /pkg/systemd/generate/common_test.go
parent6213488d2beb5a9fdd4aeb5584d3537fbabdbcd0 (diff)
parent2fed50f4319a9204b5cb86c2924179963f111aae (diff)
downloadpodman-3022d70285c2de2f6819a1637a06751d329eb751.tar.gz
podman-3022d70285c2de2f6819a1637a06751d329eb751.tar.bz2
podman-3022d70285c2de2f6819a1637a06751d329eb751.zip
Merge pull request #6768 from vrothberg/fix-6766
generate systemd: improve pod-flags filter
Diffstat (limited to 'pkg/systemd/generate/common_test.go')
-rw-r--r--pkg/systemd/generate/common_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/systemd/generate/common_test.go b/pkg/systemd/generate/common_test.go
index f53bb7828..389c30f59 100644
--- a/pkg/systemd/generate/common_test.go
+++ b/pkg/systemd/generate/common_test.go
@@ -1,6 +1,7 @@
package generate
import (
+ "strings"
"testing"
"github.com/stretchr/testify/assert"
@@ -14,12 +15,16 @@ func TestFilterPodFlags(t *testing.T) {
{[]string{"podman", "pod", "create"}},
{[]string{"podman", "pod", "create", "--name", "foo"}},
{[]string{"podman", "pod", "create", "--pod-id-file", "foo"}},
+ {[]string{"podman", "pod", "create", "--pod-id-file=foo"}},
{[]string{"podman", "run", "--pod", "foo"}},
+ {[]string{"podman", "run", "--pod=foo"}},
}
for _, test := range tests {
processed := filterPodFlags(test.input)
- assert.NotContains(t, processed, "--pod-id-file")
- assert.NotContains(t, processed, "--pod")
+ for _, s := range processed {
+ assert.False(t, strings.HasPrefix(s, "--pod-id-file"))
+ assert.False(t, strings.HasPrefix(s, "--pod"))
+ }
}
}