зеркало из https://github.com/microsoft/docker.git
Merge pull request #10913 from ahmetalpbalkan/win-cli/UnixSpecific-skip
integ-cli: Skip some unix-specific cli tests
This commit is contained in:
Коммит
695bf3348f
|
@ -1673,6 +1673,8 @@ func TestBuildAddBadLinksVolume(t *testing.T) {
|
|||
// Issue #5270 - ensure we throw a better error than "unexpected EOF"
|
||||
// when we can't access files in the context.
|
||||
func TestBuildWithInaccessibleFilesInContext(t *testing.T) {
|
||||
testRequires(t, UnixCli) // test uses chown/chmod: not available on windows
|
||||
|
||||
{
|
||||
name := "testbuildinaccessiblefiles"
|
||||
defer deleteImages(name)
|
||||
|
@ -4387,6 +4389,8 @@ func TestBuildStderr(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestBuildChownSingleFile(t *testing.T) {
|
||||
testRequires(t, UnixCli) // test uses chown: not available on windows
|
||||
|
||||
name := "testbuildchownsinglefile"
|
||||
defer deleteImages(name)
|
||||
|
||||
|
@ -4658,6 +4662,8 @@ func TestBuildFromOfficialNames(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestBuildDockerfileOutsideContext(t *testing.T) {
|
||||
testRequires(t, UnixCli) // uses os.Symlink: not implemented in windows at the time of writing (go-1.4.2)
|
||||
|
||||
name := "testbuilddockerfileoutsidecontext"
|
||||
tmpdir, err := ioutil.TempDir("", name)
|
||||
if err != nil {
|
||||
|
|
|
@ -347,6 +347,8 @@ func TestCpSymlinkComponent(t *testing.T) {
|
|||
|
||||
// Check that cp with unprivileged user doesn't return any error
|
||||
func TestCpUnprivilegedUser(t *testing.T) {
|
||||
testRequires(t, UnixCli) // uses chmod/su: not available on windows
|
||||
|
||||
out, exitCode, err := dockerCmd(t, "run", "-d", "busybox", "/bin/sh", "-c", "touch "+cpTestName)
|
||||
if err != nil || exitCode != 0 {
|
||||
t.Fatal("failed to create a container", out, err)
|
||||
|
|
|
@ -17,6 +17,10 @@ var (
|
|||
func() bool { return isLocalDaemon },
|
||||
"Test requires docker daemon to runs on the same machine as CLI",
|
||||
}
|
||||
UnixCli = TestRequirement{
|
||||
func() bool { return isUnixCli },
|
||||
"Test requires posix utilities or functionality to run.",
|
||||
}
|
||||
)
|
||||
|
||||
// testRequires checks if the environment satisfies the requirements
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
const (
|
||||
// identifies if test suite is running on a unix platform
|
||||
isUnixCli = true
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
// +build windows
|
||||
|
||||
package main
|
||||
|
||||
const (
|
||||
// identifies if test suite is running on a unix platform
|
||||
isUnixCli = false
|
||||
)
|
Загрузка…
Ссылка в новой задаче