]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_libcephfs: fix LibCephFS.OpenLayout test
authorSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 17:28:45 +0000 (13:28 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:42:36 +0000 (09:42 -0400)
We can't make assumptions about the name of the data pool.

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/libcephfs/test.cc

index 5f8e3439f0165b8d3d95faa14558f9e2ca112860..d49a64b0b6aebb9e0248b8ba9349814192d1e69f 100644 (file)
@@ -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) */