]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Add test for admin heap profiling command.
authorJesse Williamson <jwilliamson@suse.de>
Mon, 12 Dec 2016 17:50:03 +0000 (09:50 -0800)
committerJesse Williamson <jwilliamson@suse.de>
Fri, 31 Mar 2017 08:22:59 +0000 (01:22 -0700)
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
qa/workunits/cephtool/test.sh

index 7801702c6ec15529f6c42f18bce3fbfef0095b33..383163f538b1564fc29260ccd90b8422dea5655c 100755 (executable)
@@ -1728,6 +1728,28 @@ function test_mon_heap_profiler()
   ceph heap release
 }
 
+function test_admin_heap_profiler()
+{
+  do_test=1
+  set +e
+  # expect 'heap' commands to be correctly parsed
+  ceph heap stats 2>$TMPFILE
+  if [[ $? -eq 22 && `grep 'tcmalloc not enabled' $TMPFILE` ]]; then
+    echo "tcmalloc not enabled; skip heap profiler test"
+    do_test=0
+  fi
+  set -e
+
+  [[ $do_test -eq 0 ]] && return 0
+
+  admin_socket = "--admin-deamon out/osd.0.asok"
+
+  ceph --admin $admin_socket heap start_profiler
+  ceph --admin $admin_socket heap dump
+  ceph --admin $admin_socket heap stop_profiler
+  ceph --admin $admin_socket heap release
+}
+
 function test_osd_bench()
 {
   # test osd bench limits