From 4cfb7dbc5c8fe1a28fb945fa12d9795943db1db5 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 30 Jul 2014 14:48:28 -0700 Subject: [PATCH] qa/workunits/cephtool/test_daemon.sh: allow local ceph command (cherry picked from commit 97a8d5a9fdbd3a25cc922c242ee57da58c57d0bc) --- qa/workunits/cephtool/test_daemon.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/qa/workunits/cephtool/test_daemon.sh b/qa/workunits/cephtool/test_daemon.sh index f598708d019ab..0e7331d103c7b 100755 --- a/qa/workunits/cephtool/test_daemon.sh +++ b/qa/workunits/cephtool/test_daemon.sh @@ -10,21 +10,24 @@ expect_false() echo note: assuming mon.a is on the currenet host -sudo ceph daemon mon.a version | grep version +# can set to 'sudo ./ceph' to execute tests from current dir for development +CEPH=${CEPH:-'sudo ceph'} + +${CEPH} daemon mon.a version | grep version # get debug_ms setting and strip it, painfully for reuse -old_ms=$(sudo ceph daemon mon.a config get debug_ms | grep debug_ms | \ - sed -e 's/.*: //' -e 's/["\}\\]//g') -sudo ceph daemon mon.a config set debug_ms 13 -new_ms=$(sudo ceph daemon mon.a config get debug_ms | grep debug_ms | \ - sed -e 's/.*: //' -e 's/["\}\\]//g') +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" ] -sudo ceph daemon mon.a config set debug_ms $old_ms -new_ms=$(sudo 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 $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" ] # unregistered/non-existent command -expect_false sudo ceph daemon mon.a bogus_command_blah foo +expect_false ${CEPH} daemon mon.a bogus_command_blah foo echo OK -- 2.39.5