uint64_t get_instance_id();
+ int mon_command(std::string cmd, const bufferlist& inbl,
+ bufferlist *outbl, std::string *outs);
+
int ioctx_create(const char *name, IoCtx &pioctx);
// Features useful for test cases
return client->pool_get_name(id, name);
}
+int librados::Rados::mon_command(string cmd, const bufferlist& inbl,
+ bufferlist *outbl, string *outs)
+{
+ vector<string> cmdvec;
+ cmdvec.push_back(cmd);
+ return client->mon_command(cmdvec, inbl, outbl, outs);
+}
+
int librados::Rados::ioctx_create(const char *name, IoCtx &io)
{
rados_ioctx_t p;
ASSERT_EQ(0, destroy_one_pool(pool_name, &cluster));
}
+TEST(LibRadosCmd, MonDescribePP) {
+ Rados cluster;
+ std::string pool_name = get_temp_pool_name();
+ ASSERT_EQ("", create_one_pool_pp(pool_name, cluster));
+
+ bufferlist inbl, outbl;
+ string outs;
+ ASSERT_EQ(0, cluster.mon_command("{\"prefix\": \"get_command_descriptions\"}",
+ inbl, &outbl, &outs));
+ ASSERT_LT(0u, outbl.length());
+ ASSERT_LE(0u, outs.length());
+
+ ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
+}
+
TEST(LibRadosCmd, OSDCmd) {
rados_t cluster;
std::string pool_name = get_temp_pool_name();