summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-30 23:04:41 -0700
committerSage Weil <sage@inktank.com>2013-07-30 23:04:41 -0700
commite70e08c060592715cf4e3403532c8239bebce690 (patch)
tree88bcfb9cfe1d4200d1cb3d9f562a6a320d768154
parent47d0d64d5c36c5b1192032438f141f88490fc26c (diff)
downloadceph-e70e08c060592715cf4e3403532c8239bebce690.tar.gz
cephtool/test.sh: add tests for mon daemon command
[Also move into a separatate test script; validate result -sage] Signed-off-by: Dan Mick <dan.mick@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
-rwxr-xr-xqa/workunits/cephtool/test_daemon.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/qa/workunits/cephtool/test_daemon.sh b/qa/workunits/cephtool/test_daemon.sh
new file mode 100755
index 00000000000..67f0f096e27
--- /dev/null
+++ b/qa/workunits/cephtool/test_daemon.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -x
+
+set -e
+
+expect_false()
+{
+ set -x
+ if "$@"; then return 1; else return 0; fi
+}
+
+echo note: assuming mon.a is on the currenet host
+
+ceph daemon mon.a version | grep version
+
+# get debug_ms setting and strip it, painfully for reuse
+old_ms=$(ceph daemon mon.a config get debug_ms | grep debug_ms | \
+ sed -e 's/.*: //' -e 's/["\}\\]//g')
+ceph daemon mon.a config set debug_ms 13
+new_ms=$(ceph daemon mon.a config get debug_ms | grep debug_ms | \
+ sed -e 's/.*: //' -e 's/["\}\\]//g')
+[ "$new_ms" = "13/13" ]
+ceph daemon mon.a config set debug_ms $old_ms
+new_ms=$(ceph daemon mon.a config get debug_ms | grep debug_ms | \
+ sed -e 's/.*: //' -e 's/["\}\\]//g')
+[ "$new_ms" = "$old_ms" ]
+
+echo OK