]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephtool/test.sh: add tests for mon daemon command
authorSage Weil <sage@inktank.com>
Wed, 31 Jul 2013 06:04:41 +0000 (23:04 -0700)
committerSage Weil <sage@inktank.com>
Wed, 31 Jul 2013 06:04:41 +0000 (23:04 -0700)
[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>
qa/workunits/cephtool/test_daemon.sh [new file with mode: 0755]

diff --git a/qa/workunits/cephtool/test_daemon.sh b/qa/workunits/cephtool/test_daemon.sh
new file mode 100755 (executable)
index 0000000..67f0f09
--- /dev/null
@@ -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