Fix TestInitializeCannotStatPathFileNameTooLong

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 7afb2347415a8e92020c037bacf5d11467c78e9b
Component: engine
This commit is contained in:
Antonio Murdaca
2015-04-15 21:15:05 +02:00
parent 72f22eceb7
commit 131a9e6fbb
+5 -5
View File
@@ -1,7 +1,7 @@
package volumes
import (
"strings"
"os"
"testing"
"github.com/docker/docker/pkg/stringutils"
@@ -33,8 +33,8 @@ func TestInitializeCannotMkdirOnNonExistentPath(t *testing.T) {
t.Fatal("Expected not to initialize volume with a non existent path")
}
if !strings.Contains(err.Error(), "mkdir : no such file or directory") {
t.Fatalf("Expected to get mkdir no such file or directory, got %s", err)
if !os.IsNotExist(err) {
t.Fatalf("Expected to get ErrNotExist error, got %s", err)
}
}
@@ -49,7 +49,7 @@ func TestInitializeCannotStatPathFileNameTooLong(t *testing.T) {
t.Fatal("Expected not to initialize volume with a non existent path")
}
if !strings.Contains(err.Error(), "file name too long") {
t.Fatalf("Expected to get ENAMETOOLONG error, got %s", err)
if os.IsNotExist(err) {
t.Fatal("Expected to not get ErrNotExist")
}
}