mirror of
https://github.com/docker/cli.git
synced 2026-01-18 08:21:31 +03:00
Merge pull request #12412 from runcom/12410-fix-TestInitializeCannotStatPathFileNameTooLong
Fix TestInitializeCannotStatPathFileNameTooLong Upstream-commit: 0c7b51089c8cd7ef3510a9b40edaa139a7ca91aa Component: engine
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user