one more windows adaptation
Signed-off-by: guillaume.tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
95179f1625
commit
df7f57e227
@ -23,6 +23,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -132,21 +133,31 @@ func TestLocalComposeUp(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func binExt() string {
|
||||||
|
binaryExt := ""
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
binaryExt = ".exe"
|
||||||
|
}
|
||||||
|
return binaryExt
|
||||||
|
}
|
||||||
func TestComposeUsingCliPlugin(t *testing.T) {
|
func TestComposeUsingCliPlugin(t *testing.T) {
|
||||||
c := NewParallelE2eCLI(t, binDir)
|
c := NewParallelE2eCLI(t, binDir)
|
||||||
|
|
||||||
err := os.Remove(filepath.Join(c.ConfigDir, "cli-plugins", "docker-compose"))
|
err := os.Remove(filepath.Join(c.ConfigDir, "cli-plugins", "docker-compose"+binExt()))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
res := c.RunDockerOrExitError("compose", "ls")
|
res := c.RunDockerOrExitError("compose", "ls")
|
||||||
res.Assert(t, icmd.Expected{Err: "'compose' is not a docker command", ExitCode: 1})
|
res.Assert(t, icmd.Expected{Err: "'compose' is not a docker command", ExitCode: 1})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestComposeCliPluginWithoutCloudIntegration(t *testing.T) {
|
func TestComposeCliPluginWithoutCloudIntegration(t *testing.T) {
|
||||||
c := NewParallelE2eCLI(t, binDir)
|
newBinFolder, cleanup, err := SetupExistingCLI() // do not share bin folder with other tests
|
||||||
|
|
||||||
err := os.Remove(filepath.Join(binDir, "docker"))
|
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
err = os.Rename(filepath.Join(binDir, "com.docker.cli"), filepath.Join(binDir, "docker"))
|
defer cleanup()
|
||||||
|
c := NewParallelE2eCLI(t, newBinFolder)
|
||||||
|
|
||||||
|
err = os.Remove(filepath.Join(newBinFolder, "docker"+binExt()))
|
||||||
|
assert.NilError(t, err)
|
||||||
|
err = os.Rename(filepath.Join(newBinFolder, "com.docker.cli"+binExt()), filepath.Join(newBinFolder, "docker"+binExt()))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
res := c.RunDockerOrExitError("compose", "ls")
|
res := c.RunDockerOrExitError("compose", "ls")
|
||||||
res.Assert(t, icmd.Expected{Out: "NAME STATUS", ExitCode: 0})
|
res.Assert(t, icmd.Expected{Out: "NAME STATUS", ExitCode: 0})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user