mirror of https://github.com/docker/docs.git
Fix engine tests on systems where temp directories are symlinked.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
a7ecc3ea11
commit
353cc8c2a5
|
@ -4,6 +4,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -64,6 +65,18 @@ func TestEngineRoot(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmp)
|
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")
|
dir := path.Join(tmp, "dir")
|
||||||
eng, err := New(dir)
|
eng, err := New(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue