]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | #!/usr/bin/env bash |
7c673cae | 2 | |
11fdf7f2 | 3 | set -ex |
7c673cae FG |
4 | |
5 | expect_false() | |
6 | { | |
7 | set -x | |
8 | if "$@"; then return 1; else return 0; fi | |
9 | } | |
10 | ||
11 | echo note: assuming mon.a is on the current host | |
12 | ||
13 | # can set to 'sudo ./ceph' to execute tests from current dir for development | |
14 | CEPH=${CEPH:-'sudo ceph'} | |
15 | ||
16 | ${CEPH} daemon mon.a version | grep version | |
17 | ||
18 | # get debug_ms setting and strip it, painfully for reuse | |
19 | old_ms=$(${CEPH} daemon mon.a config get debug_ms | \ | |
20 | grep debug_ms | sed -e 's/.*: //' -e 's/["\}\\]//g') | |
21 | ${CEPH} daemon mon.a config set debug_ms 13 | |
22 | new_ms=$(${CEPH} daemon mon.a config get debug_ms | \ | |
23 | grep debug_ms | sed -e 's/.*: //' -e 's/["\}\\]//g') | |
24 | [ "$new_ms" = "13/13" ] | |
25 | ${CEPH} daemon mon.a config set debug_ms $old_ms | |
26 | new_ms=$(${CEPH} daemon mon.a config get debug_ms | \ | |
27 | grep debug_ms | sed -e 's/.*: //' -e 's/["\}\\]//g') | |
28 | [ "$new_ms" = "$old_ms" ] | |
29 | ||
30 | # unregistered/non-existent command | |
31 | expect_false ${CEPH} daemon mon.a bogus_command_blah foo | |
32 | ||
33 | set +e | |
34 | OUTPUT=$(${CEPH} -c /not/a/ceph.conf daemon mon.a help 2>&1) | |
35 | # look for EINVAL | |
36 | if [ $? != 22 ] ; then exit 1; fi | |
37 | if ! echo "$OUTPUT" | grep -q '.*open.*/not/a/ceph.conf'; then | |
38 | echo "didn't find expected error in bad conf search" | |
39 | exit 1 | |
40 | fi | |
41 | set -e | |
42 | ||
43 | echo OK |