diff options
author | Qi Wang <qiwan@redhat.com> | 2019-04-11 15:59:30 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2019-05-02 12:14:51 -0400 |
commit | a477a8ff755e2807d0745b207d6a5bf57de58e4c (patch) | |
tree | a7a6f479c733c42ddc7aca2a30b1c753cf9238bb /cmd/podman/shared/funcs_test.go | |
parent | 7d05ff3fc772a7be4860ed4a3cd59a62f8bb893a (diff) | |
download | podman-a477a8ff755e2807d0745b207d6a5bf57de58e4c.tar.gz podman-a477a8ff755e2807d0745b207d6a5bf57de58e4c.tar.bz2 podman-a477a8ff755e2807d0745b207d6a5bf57de58e4c.zip |
Add variable for global flags to runlabel
use $GLOBAL_OPTS to pass global flags to the runlabel command.
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman/shared/funcs_test.go')
-rw-r--r-- | cmd/podman/shared/funcs_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/podman/shared/funcs_test.go b/cmd/podman/shared/funcs_test.go index 7506b9d9c..c05348242 100644 --- a/cmd/podman/shared/funcs_test.go +++ b/cmd/podman/shared/funcs_test.go @@ -20,7 +20,7 @@ var ( func TestGenerateCommand(t *testing.T) { 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") + newCommand, err := GenerateCommand(inputCommand, "foo", "bar", "") assert.Nil(t, err) assert.Equal(t, "hello world", newCommand[11]) assert.Equal(t, correctCommand, strings.Join(newCommand, " ")) @@ -83,7 +83,7 @@ func TestGenerateCommandCheckSubstitution(t *testing.T) { } for _, test := range tests { - newCommand, err := GenerateCommand(test.input, "foo", "bar") + newCommand, err := GenerateCommand(test.input, "foo", "bar", "") if test.shouldFail { assert.NotNil(t, err) } else { @@ -96,14 +96,14 @@ func TestGenerateCommandCheckSubstitution(t *testing.T) { func TestGenerateCommandPath(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" - newCommand, _ := GenerateCommand(inputCommand, "foo", "bar") + newCommand, _ := GenerateCommand(inputCommand, "foo", "bar", "") assert.Equal(t, correctCommand, strings.Join(newCommand, " ")) } func TestGenerateCommandNoSetName(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 foo -e NAME=foo -e IMAGE=foo foo echo install" - newCommand, err := GenerateCommand(inputCommand, "foo", "") + newCommand, err := GenerateCommand(inputCommand, "foo", "", "") assert.Nil(t, err) assert.Equal(t, correctCommand, strings.Join(newCommand, " ")) } @@ -111,7 +111,7 @@ 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" - newCommand, err := GenerateCommand(inputCommand, "foo", "") + newCommand, err := GenerateCommand(inputCommand, "foo", "", "") assert.Nil(t, err) assert.Equal(t, correctCommand, strings.Join(newCommand, " ")) } @@ -119,7 +119,7 @@ func TestGenerateCommandNoName(t *testing.T) { func TestGenerateCommandAlreadyPodman(t *testing.T) { inputCommand := "podman 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" - newCommand, err := GenerateCommand(inputCommand, "foo", "bar") + newCommand, err := GenerateCommand(inputCommand, "foo", "bar", "") assert.Nil(t, err) assert.Equal(t, correctCommand, strings.Join(newCommand, " ")) } |