]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephtool/test_daemon.sh: allow local ceph command
authorDan Mick <dan.mick@inktank.com>
Wed, 30 Jul 2014 21:48:28 +0000 (14:48 -0700)
committerSage Weil <sage@redhat.com>
Sat, 2 Aug 2014 00:05:47 +0000 (17:05 -0700)
(cherry picked from commit 97a8d5a9fdbd3a25cc922c242ee57da58c57d0bc)

qa/workunits/cephtool/test_daemon.sh

index f598708d019ab58496e87abaea3d0ddb898439bd..0e7331d103c7b24e6e6564a63ecf80dade5b8a4c 100755 (executable)
@@ -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