Skip to content

Commit

Permalink
test/smoke.sh: add simple ceph-helpers-based smoke test
Browse files Browse the repository at this point in the history
This is just enough during make check to know things aren't totally
broken.

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Jul 26, 2017
1 parent 742005b commit 6be179a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests)
add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh)
add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
add_ceph_test(test_subman.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_subman.sh)
add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh)
add_ceph_test(unittest_bufferlist.sh ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh)

add_test(NAME run-tox-ceph-disk COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-disk/run-tox.sh)
Expand Down
63 changes: 63 additions & 0 deletions src/test/smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

source $CEPH_ROOT/qa/standalone/ceph-helpers.sh

function run() {
local dir=$1
shift

export CEPH_MON="127.0.0.1:7224" # git grep '\<7224\>' : there must be only one
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
CEPH_ARGS+="--mon-host=$CEPH_MON "
set -e

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_minimal() {
local dir=$1

run_mon $dir a
run_mgr $dir x
run_osd $dir 0
run_osd $dir 1
run_osd $dir 2
create_rbd_pool
wait_for_clean
}

function TEST_multimon() {
local dir=$1

MONA="127.0.0.1:7224" # git grep '\<7224\>' : there must be only one
MONB="127.0.0.1:7225" # git grep '\<7225\>' : there must be only one
MONC="127.0.0.1:7226" # git grep '\<7226\>' : there must be only one

run_mon $dir a --public-addr $MONA
run_mon $dir b --public-addr $MONB
run_mon $dir c --public_addr $MONC
run_mgr $dir x
run_mgr $dir y
run_osd $dir 0
run_osd $dir 1
run_osd $dir 2

ceph osd pool create foo 32
ceph osd out 0
wait_for_clean

rados -p foo bench 4 write -b 4096 --no-cleanup
wait_for_clean

ceph osd in 0
flush_pg_stats
wait_for_clean
}

main smoke "$@"

0 comments on commit 6be179a

Please sign in to comment.