From: Sage Weil Date: Sat, 27 Jul 2013 05:28:40 +0000 (-0700) Subject: test/admin_socket: fix admin_socket unit tests X-Git-Tag: v0.67-rc3~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd0e35f2e198b7a0683e185e4969a26488be8386;p=ceph.git test/admin_socket: fix admin_socket unit tests Command is now JSON! Signed-off-by: Sage Weil --- diff --git a/src/test/admin_socket.cc b/src/test/admin_socket.cc index 7f595f596186..8f67918e644e 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()); }