]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Check for empty output in test_dump_pgstate_history 20838/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 9 Mar 2018 04:35:36 +0000 (14:35 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 9 Mar 2018 04:35:36 +0000 (14:35 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/test/admin_socket_output_tests.cc

index 72a573b78092718d4696dbd64894470254af4c68..58bc036540805a8a79d6335979cc88d451334279 100644 (file)
@@ -36,6 +36,11 @@ bool test_dump_pgstate_history(std::string &output) {
   }
 
   JSONObjIter iter = parser.find_first();
+  if (iter.end()) { //Empty
+    std::cerr << "test_dump_pgstate_history: command output empty, failing"
+              << std::endl;
+    return false;
+  }
   for (; !iter.end(); ++iter) {
     if ((*iter)->get_name() == "pg") {
       ret = !(*iter)->get_data().empty();