Skip to content

Commit

Permalink
Merge pull request ceph#5859 from jecluis/wip-test-mon-ping
Browse files Browse the repository at this point in the history
test: mon/mon-ping.sh: make sure 'ceph mon ping' works as expected

Reviewed-by: Loic Dachary <[email protected]>
  • Loading branch information
jecluis committed Sep 10, 2015
2 parents 50c9bee + 94d84cc commit 046bdf8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ add_dependencies(check osd_crush)
add_test(NAME mon_scrub COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mon-scrub.sh)
add_dependencies(check mon_scrub)

add_test(NAME mon_ping COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mon-ping.sh)
add_dependencies(check mon_ping)

add_test(NAME test_ceph_daemon COMMAND python ${CMAKE_SOURCE_DIR}/src/test/pybind/test_ceph_daemon.py)
add_dependencies(check test_ceph_daemon)

Expand Down
1 change: 1 addition & 0 deletions src/test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ check_SCRIPTS += \
test/mon/osd-pool-create.sh \
test/mon/misc.sh \
test/mon/osd-crush.sh \
test/mon/mon-ping.sh \
test/mon/osd-erasure-code-profile.sh \
test/mon/mkfs.sh \
test/mon/mon-scrub.sh \
Expand Down
46 changes: 46 additions & 0 deletions src/test/mon/mon-ping.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Copyright (C) 2015 SUSE LINUX GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
source ../qa/workunits/ceph-helpers.sh

function run() {
local dir=$1
shift

export CEPH_MON="127.0.0.1:7119"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
CEPH_ARGS+="--mon-host=$CEPH_MON "

local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
for func in $funcs ; do
setup $dir || return 1
$func $dir || return 1
teardown $dir || return 1
done
}

function TEST_mon_ping() {
local dir=$1

run_mon $dir a || return 1

./ceph ping mon.a || return 1
}

main mon-ping "$@"

# Local Variables:
# compile-command: "cd ../.. ; make -j4 && test/mon/mon-ping.sh"
# End:

0 comments on commit 046bdf8

Please sign in to comment.