summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/systemd/generate/common_test.go')
-rw-r--r--pkg/systemd/generate/common_test.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkg/systemd/generate/common_test.go b/pkg/systemd/generate/common_test.go
index 45004ecb0..b9a43df8c 100644
--- a/pkg/systemd/generate/common_test.go
+++ b/pkg/systemd/generate/common_test.go
@@ -146,7 +146,7 @@ func TestEscapeSystemdArguments(t *testing.T) {
}{
{
[]string{"foo", "bar=\"arg\""},
- []string{"foo", "bar=\"arg\""},
+ []string{"foo", "\"bar=\\\"arg\\\"\""},
},
{
[]string{"foo", "bar=\"arg with space\""},
@@ -192,6 +192,22 @@ func TestEscapeSystemdArguments(t *testing.T) {
[]string{"foo", `command with two backslashes \\`},
[]string{"foo", `"command with two backslashes \\\\"`},
},
+ {
+ []string{"podman", "create", "--entrypoint", "foo"},
+ []string{"podman", "create", "--entrypoint", "foo"},
+ },
+ {
+ []string{"podman", "create", "--entrypoint=foo"},
+ []string{"podman", "create", "--entrypoint=foo"},
+ },
+ {
+ []string{"podman", "create", "--entrypoint", "[\"foo\"]"},
+ []string{"podman", "create", "--entrypoint", "\"[\\\"foo\\\"]\""},
+ },
+ {
+ []string{"podman", "create", "--entrypoint", "[\"sh\", \"-c\", \"date '+%s'\"]"},
+ []string{"podman", "create", "--entrypoint", "\"[\\\"sh\\\", \\\"-c\\\", \\\"date '+%%s'\\\"]\""},
+ },
}
for _, test := range tests {