summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-26 22:28:40 -0700
committerSage Weil <sage@inktank.com>2013-07-26 22:28:40 -0700
commitbd0e35f2e198b7a0683e185e4969a26488be8386 (patch)
tree3a39d807aaf32eb7cbf50aa830f63c3a77cbacaf
parent94865368ca76368af72f39688eb688a4bee136b6 (diff)
downloadceph-bd0e35f2e198b7a0683e185e4969a26488be8386.tar.gz
test/admin_socket: fix admin_socket unit tests
Command is now JSON! Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/test/admin_socket.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/admin_socket.cc b/src/test/admin_socket.cc
index 7f595f59618..8f67918e644 100644
--- a/src/test/admin_socket.cc
+++ b/src/test/admin_socket.cc
@@ -64,7 +64,7 @@ TEST(AdminSocket, SendNoOp) {
ASSERT_EQ(true, asoct.init(get_rand_socket_path()));
AdminSocketClient client(get_rand_socket_path());
string version;
- ASSERT_EQ("", client.do_request("0", &version));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"0\"}", &version));
ASSERT_EQ(CEPH_ADMIN_SOCK_VERSION, version);
ASSERT_EQ(true, asoct.shutdown());
}
@@ -87,7 +87,7 @@ TEST(AdminSocket, RegisterCommand) {
AdminSocketClient client(get_rand_socket_path());
ASSERT_EQ(0, asoct.m_asokc->register_command("test", "test", new MyTest(), ""));
string result;
- ASSERT_EQ("", client.do_request("test", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test\"}", &result));
ASSERT_EQ("test|", result);
ASSERT_EQ(true, asoct.shutdown());
}
@@ -111,20 +111,20 @@ TEST(AdminSocket, RegisterCommandPrefixes) {
ASSERT_EQ(0, asoct.m_asokc->register_command("test", "test", new MyTest(), ""));
ASSERT_EQ(0, asoct.m_asokc->register_command("test command", "test command", new MyTest2(), ""));
string result;
- ASSERT_EQ("", client.do_request("test", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test\"}", &result));
ASSERT_EQ("test|", result);
- ASSERT_EQ("", client.do_request("test command", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test command\"}", &result));
ASSERT_EQ("test command|", result);
- ASSERT_EQ("", client.do_request("test command post", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test command post\"}", &result));
ASSERT_EQ("test command|post", result);
- ASSERT_EQ("", client.do_request("test command post", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test command post\"}", &result));
ASSERT_EQ("test command| post", result);
- ASSERT_EQ("", client.do_request("test this thing", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test this thing\"}", &result));
ASSERT_EQ("test|this thing", result);
- ASSERT_EQ("", client.do_request("test command post", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test command post\"}", &result));
ASSERT_EQ("test| command post", result);
- ASSERT_EQ("", client.do_request("test this thing", &result));
+ ASSERT_EQ("", client.do_request("{\"prefix\":\"test this thing\"}", &result));
ASSERT_EQ("test| this thing", result);
ASSERT_EQ(true, asoct.shutdown());
}