From 2566e2604c2e079f9597749a1da11f22bb39eb51 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 9 Sep 2013 14:44:19 +0200 Subject: [PATCH] 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. --- api_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api_test.go b/api_test.go index d24cf7cfda..edff6788e1 100644 --- a/api_test.go +++ b/api_test.go @@ -647,13 +647,21 @@ func TestPostContainersCreate(t *testing.T) { 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) { utils.Debugf("Err: %s", err) t.Fatalf("The test file has not been created") } t.Fatal(err) } + + if err := container.Unmount(); err != nil { + t.Fatalf("Unable to unmount container: %s", err) + } } func TestPostContainersKill(t *testing.T) {