Merge pull request #10913 from ahmetalpbalkan/win-cli/UnixSpecific-skip

integ-cli: Skip some unix-specific cli tests
This commit is contained in:
Jessie Frazelle 2015-02-20 10:33:28 -08:00
Родитель c5aca86654 5d615dff10
Коммит 695bf3348f
5 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -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
)