From 8d64fee429832e0f05f10aabea55c062fe46b654 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Mon, 29 Aug 2011 11:33:36 -0700 Subject: [PATCH] testlibrbdpp: test librbd::Image::copy Signed-off-by: Colin McCabe --- src/testlibrbdpp.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/testlibrbdpp.cc b/src/testlibrbdpp.cc index 4a6de01265ef3..6034119285002 100644 --- a/src/testlibrbdpp.cc +++ b/src/testlibrbdpp.cc @@ -31,6 +31,7 @@ using namespace std; #define TEST_IMAGE "testimg" +#define TEST_IMAGE2 "testimg2" #define TEST_POOL "librbdtest" #define TEST_SNAP "testsnap" #define TEST_IO_SIZE 513 @@ -237,6 +238,16 @@ void test_io(librados::IoCtx& io_ctx, librbd::Image& image) } +void test_rbd_copy(librados::IoCtx& io_ctx, librbd::Image& image) +{ + int ret; + ret = image.copy(io_ctx, TEST_IMAGE2); + if (ret < 0) { + fprintf(stderr, "image.copy returned %d!\n", ret); + abort(); + } +} + int main(int argc, const char **argv) { librados::Rados rados; @@ -275,6 +286,7 @@ int main(int argc, const char **argv) test_ls(io_ctx, 1, TEST_IMAGE "1"); test_delete(io_ctx, TEST_IMAGE "1"); test_ls(io_ctx, 0); + test_rbd_copy(io_ctx, image); delete rbd; return 0; } -- 2.39.5