test: remove ceph_test_rados_api_tmap_migrate

see also: http://tracker.ceph.com/issues/16144

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2016-07-12 15:07:48 +08:00
parent 77143c6511
commit 53af28db6e
4 changed files with 0 additions and 84 deletions

View File

@ -17,7 +17,6 @@ for f in \
api_tier api_pool api_snapshots api_stat api_watch_notify api_cmd \
api_c_write_operations \
api_c_read_operations \
api_tmap_migrate \
list_parallel \
open_pools_parallel \
delete_pools_parallel \

View File

@ -291,14 +291,6 @@ ceph_test_rados_api_lock_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDAD
ceph_test_rados_api_lock_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rados_api_lock
if WITH_MDS
ceph_test_rados_api_tmap_migrate_SOURCES = test/librados/tmap_migrate.cc tools/cephfs/DataScan.cc tools/cephfs/MDSUtility.cc
ceph_test_rados_api_tmap_migrate_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(LIBMDS) libcls_cephfs_client.la $(CEPH_GLOBAL) $(RADOS_TEST_LDADD)
ceph_test_rados_api_tmap_migrate_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rados_api_tmap_migrate
endif
ceph_test_stress_watch_SOURCES = test/test_stress_watch.cc
ceph_test_stress_watch_LDADD = \
$(LIBRADOS) $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)

View File

@ -141,16 +141,6 @@ set_target_properties(ceph_test_rados_api_snapshots PROPERTIES COMPILE_FLAGS
target_link_libraries(ceph_test_rados_api_snapshots
librados ${UNITTEST_LIBS} radostest)
# ceph_test_rados_api_tmap_migrate
add_executable(ceph_test_rados_api_tmap_migrate
${CMAKE_SOURCE_DIR}/src/tools/cephfs/DataScan.cc
${CMAKE_SOURCE_DIR}/src/tools/cephfs/MDSUtility.cc
tmap_migrate.cc
)
set_target_properties(ceph_test_rados_api_tmap_migrate PROPERTIES COMPILE_FLAGS
${UNITTEST_CXX_FLAGS})
target_link_libraries(ceph_test_rados_api_tmap_migrate
librados mds osdc global cls_cephfs_client ${UNITTEST_LIBS} radostest)
install(TARGETS
ceph_test_rados_api_aio
ceph_test_rados_api_c_read_operations
@ -164,7 +154,6 @@ install(TARGETS
ceph_test_rados_api_snapshots
ceph_test_rados_api_stat
ceph_test_rados_api_tier
ceph_test_rados_api_tmap_migrate
ceph_test_rados_api_watch_notify
DESTINATION ${CMAKE_INSTALL_BINDIR})

View File

@ -1,64 +0,0 @@
#include "include/rados/librados.h"
#include "include/rados/librados.hpp"
#include "test/librados/test.h"
#include "test/librados/TestCase.h"
#include "include/encoding.h"
#include "tools/cephfs/DataScan.h"
#include "global/global_init.h"
#include <algorithm>
#include <errno.h>
#include "gtest/gtest.h"
using namespace librados;
typedef RadosTestPP TmapMigratePP;
TEST_F(TmapMigratePP, DataScan) {
std::vector<const char *> args;
global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
// DataScan isn't namespace-aware, so override RadosTestPP's default
// behaviour of putting everything into a namespace
ioctx.set_namespace("");
bufferlist header;
std::map<std::string, bufferlist> kvs;
bufferlist val;
val.append("custard");
kvs.insert({"rhubarb", val});
bufferlist tmap_trans;
::encode(header, tmap_trans);
::encode(kvs, tmap_trans);
// Create a TMAP object
ASSERT_EQ(0, ioctx.tmap_put("10000000000.00000000", tmap_trans));
// Create an OMAP object
std::map<std::string, bufferlist> omap_kvs;
bufferlist omap_val;
omap_val.append("waffles");
omap_kvs.insert({"tasty", omap_val});
ASSERT_EQ(0, ioctx.omap_set("10000000001.00000000", omap_kvs));
// Check that the TMAP object is now an omap object
std::map<std::string, bufferlist> read_vals;
ASSERT_EQ(0, ioctx.omap_get_vals("10000000000.00000000", "", 1, &read_vals));
ASSERT_EQ(read_vals.size(), 1u);
bufferlist tmap_expect_val;
tmap_expect_val.append("custard");
ASSERT_EQ(read_vals.at("rhubarb"), tmap_expect_val);
// Check that the OMAP object is still readable
read_vals.clear();
ASSERT_EQ(0, ioctx.omap_get_vals("10000000001.00000000", "", 1, &read_vals));
ASSERT_EQ(read_vals.size(), 1u);
bufferlist expect_omap_val;
expect_omap_val.append("waffles");
ASSERT_EQ(read_vals.at("tasty"), expect_omap_val);
}