From 94d84ccd958aa4ece47ea1b96deb763b7d70b32b Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Wed, 9 Sep 2015 20:08:38 +0100 Subject: [PATCH] test: mon/mon-ping.sh: make sure 'ceph mon ping' works as expected Signed-off-by: Joao Eduardo Luis --- src/test/CMakeLists.txt | 3 +++ src/test/Makefile.am | 1 + src/test/mon/mon-ping.sh | 46 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100755 src/test/mon/mon-ping.sh diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 71f304c5c1941..18ea8815758e2 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -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) diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 65f1f77fdc35a..89fc7dfa7603a 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -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 \ diff --git a/src/test/mon/mon-ping.sh b/src/test/mon/mon-ping.sh new file mode 100755 index 0000000000000..e3f7395658aac --- /dev/null +++ b/src/test/mon/mon-ping.sh @@ -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: -- 2.39.5