Skip to content

Commit

Permalink
test: remove hard-coded image name from RBD metadata test
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/19798
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8f72e74)
  • Loading branch information
Jason Dillaman authored and smithfarm committed Jul 4, 2017
1 parent 474d504 commit bd9aec0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/test/librbd/test_librbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4784,20 +4784,23 @@ TEST_F(TestLibRBD, Mirror) {

// Add some images to the pool
int order = 0;
ASSERT_EQ(0, create_image_pp(rbd, ioctx, "parent", 2 << 20, &order));
std::string parent_name = get_temp_image_name();
std::string child_name = get_temp_image_name();
ASSERT_EQ(0, create_image_pp(rbd, ioctx, parent_name.c_str(), 2 << 20,
&order));
bool old_format;
uint64_t features;
ASSERT_EQ(0, get_features(&old_format, &features));
if ((features & RBD_FEATURE_LAYERING) != 0) {
librbd::Image parent;
ASSERT_EQ(0, rbd.open(ioctx, parent, "parent", NULL));
ASSERT_EQ(0, rbd.open(ioctx, parent, parent_name.c_str(), NULL));
ASSERT_EQ(0, parent.snap_create("parent_snap"));
ASSERT_EQ(0, parent.close());
ASSERT_EQ(0, rbd.open(ioctx, parent, "parent", "parent_snap"));
ASSERT_EQ(0, rbd.open(ioctx, parent, parent_name.c_str(), "parent_snap"));
ASSERT_EQ(0, parent.snap_protect("parent_snap"));
ASSERT_EQ(0, parent.close());
ASSERT_EQ(0, rbd.clone(ioctx, "parent", "parent_snap", ioctx, "child",
features, &order));
ASSERT_EQ(0, rbd.clone(ioctx, parent_name.c_str(), "parent_snap", ioctx,
child_name.c_str(), features, &order));
}

ASSERT_EQ(RBD_MIRROR_MODE_IMAGE, mirror_mode);
Expand Down

0 comments on commit bd9aec0

Please sign in to comment.