mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
api_test: Fix PostContainersCreate
We can't look for the created file in the rwpath, because that doesn't exist in the device-mapper world, instead look in the RootfsPath.
This commit is contained in:
parent
e1c418cac3
commit
2566e2604c
1 changed files with 9 additions and 1 deletions
10
api_test.go
10
api_test.go
|
@ -647,13 +647,21 @@ func TestPostContainersCreate(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(path.Join(container.rwPath(), "test")); err != nil {
|
if err := container.EnsureMounted(); err != nil {
|
||||||
|
t.Fatalf("Unable to mount container: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(path.Join(container.RootfsPath(), "test")); err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
utils.Debugf("Err: %s", err)
|
utils.Debugf("Err: %s", err)
|
||||||
t.Fatalf("The test file has not been created")
|
t.Fatalf("The test file has not been created")
|
||||||
}
|
}
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := container.Unmount(); err != nil {
|
||||||
|
t.Fatalf("Unable to unmount container: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPostContainersKill(t *testing.T) {
|
func TestPostContainersKill(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue