From: Sage Weil Date: Thu, 3 Sep 2015 17:28:45 +0000 (-0400) Subject: ceph_test_libcephfs: fix LibCephFS.OpenLayout test X-Git-Tag: v10.0.0~123^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=283be861ce30f02f8684ec39ce485d18ad0448bd;p=ceph.git ceph_test_libcephfs: fix LibCephFS.OpenLayout test We can't make assumptions about the name of the data pool. Signed-off-by: Sage Weil --- diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index 5f8e3439f0165..d49a64b0b6aeb 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -182,8 +182,7 @@ TEST(LibCephFS, OpenLayout) { ASSERT_GT(fd, 0); char poolname[80]; ASSERT_LT(0, ceph_get_file_pool_name(cmount, fd, poolname, sizeof(poolname))); - ASSERT_EQ(4, ceph_get_file_pool_name(cmount, fd, poolname, 0)); - ASSERT_EQ(0, strcmp("data", poolname)); + ASSERT_LT(0, ceph_get_file_pool_name(cmount, fd, poolname, 0)); /* on already-written file (ENOTEMPTY) */ ceph_write(cmount, fd, "hello world", 11, 0); @@ -202,10 +201,8 @@ TEST(LibCephFS, OpenLayout) { /* with data pool */ sprintf(test_layout_file, "test_layout_%d_d", getpid()); - fd = ceph_open_layout(cmount, test_layout_file, O_CREAT, 0666, (1<<20), 7, (1<<20), "data"); + fd = ceph_open_layout(cmount, test_layout_file, O_CREAT, 0666, (1<<20), 7, (1<<20), poolname); ASSERT_GT(fd, 0); - ASSERT_EQ(4, ceph_get_file_pool_name(cmount, fd, poolname, sizeof(poolname))); - ASSERT_EQ(0, strcmp("data", poolname)); ceph_close(cmount, fd); /* with metadata pool (invalid) */