1
0
mirror of https://github.com/docker/cli.git synced 2026-01-16 20:22:36 +03:00

Merge pull request #4167 from shykes/fix-tests-mac

Fix or document broken tests on mac
Upstream-commit: 19e44217f5a22f94395207f9389c257b433c7c7d
Component: engine
This commit is contained in:
Guillaume J. Charmes
2014-02-17 11:01:17 -08:00
2 changed files with 15 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import (
"io/ioutil"
"os"
"path"
"path/filepath"
"testing"
)
@@ -64,6 +65,18 @@ func TestEngineRoot(t *testing.T) {
t.Fatal(err)
}
defer os.RemoveAll(tmp)
// We expect Root to resolve to an absolute path.
// FIXME: this should not be necessary.
// Until the above FIXME is implemented, let's check for the
// current behavior.
tmp, err = filepath.EvalSymlinks(tmp)
if err != nil {
t.Fatal(err)
}
tmp, err = filepath.Abs(tmp)
if err != nil {
t.Fatal(err)
}
dir := path.Join(tmp, "dir")
eng, err := New(dir)
if err != nil {

View File

@@ -31,6 +31,8 @@ func mkTestTagStore(root string, t *testing.T) *TagStore {
t.Fatal(err)
}
img := &Image{ID: testImageID}
// FIXME: this fails on Darwin with:
// tags_unit_test.go:36: mkdir /var/folders/7g/b3ydb5gx4t94ndr_cljffbt80000gq/T/docker-test569b-tRunner-075013689/vfs/dir/foo/etc/postgres: permission denied
if err := graph.Register(nil, archive, img); err != nil {
t.Fatal(err)
}