mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00

Create a new template for generating a pod unit file. Eventually, this allows for treating and extending pod and container generation seprately. The `--new` flag now also works on pods. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
26 lines
551 B
Go
26 lines
551 B
Go
package generate
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFilterPodFlags(t *testing.T) {
|
|
|
|
tests := []struct {
|
|
input []string
|
|
}{
|
|
{[]string{"podman", "pod", "create"}},
|
|
{[]string{"podman", "pod", "create", "--name", "foo"}},
|
|
{[]string{"podman", "pod", "create", "--pod-id-file", "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")
|
|
}
|
|
}
|