summaryrefslogtreecommitdiff
path: root/cmd/podman/shared/funcs_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-16 08:18:28 -0800
committerGitHub <noreply@github.com>2018-11-16 08:18:28 -0800
commit4abf439e4bda8836cd68101d1f1cb09bc9105b17 (patch)
tree57c9884a23aedfc95ddb05fccc456d6b791b24e9 /cmd/podman/shared/funcs_test.go
parent43de95df34a88d2ded4b62ab0c1763a33acac07e (diff)
parent780b790415f94ea41ef70bd97828ecb92a4f06d1 (diff)
downloadpodman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.tar.gz
podman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.tar.bz2
podman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.zip
Merge pull request #1822 from vrothberg/runlabel-shlexing
runlabel: use shlex for splitting commands
Diffstat (limited to 'cmd/podman/shared/funcs_test.go')
-rw-r--r--cmd/podman/shared/funcs_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/shared/funcs_test.go b/cmd/podman/shared/funcs_test.go
index 596df84e8..7506b9d9c 100644
--- a/cmd/podman/shared/funcs_test.go
+++ b/cmd/podman/shared/funcs_test.go
@@ -18,10 +18,11 @@ var (
)
func TestGenerateCommand(t *testing.T) {
- inputCommand := "docker run -it --name NAME -e NAME=NAME -e IMAGE=IMAGE IMAGE echo install"
- correctCommand := "/proc/self/exe run -it --name bar -e NAME=bar -e IMAGE=foo foo echo install"
+ inputCommand := "docker run -it --name NAME -e NAME=NAME -e IMAGE=IMAGE IMAGE echo \"hello world\""
+ correctCommand := "/proc/self/exe run -it --name bar -e NAME=bar -e IMAGE=foo foo echo hello world"
newCommand, err := GenerateCommand(inputCommand, "foo", "bar")
assert.Nil(t, err)
+ assert.Equal(t, "hello world", newCommand[11])
assert.Equal(t, correctCommand, strings.Join(newCommand, " "))
}
@@ -108,8 +109,8 @@ func TestGenerateCommandNoSetName(t *testing.T) {
}
func TestGenerateCommandNoName(t *testing.T) {
- inputCommand := "docker run -it -e IMAGE=IMAGE IMAGE echo install"
- correctCommand := "/proc/self/exe run -it -e IMAGE=foo foo echo install"
+ inputCommand := "docker run -it -e IMAGE=IMAGE IMAGE echo install"
+ correctCommand := "/proc/self/exe run -it -e IMAGE=foo foo echo install"
newCommand, err := GenerateCommand(inputCommand, "foo", "")
assert.Nil(t, err)
assert.Equal(t, correctCommand, strings.Join(newCommand, " "))