Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / smoke.sh
1 #!/bin/bash
2
3 source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
4
5 function run() {
6     local dir=$1
7     shift
8
9     export CEPH_MON="127.0.0.1:7224" # git grep '\<7224\>' : there must be only one
10     export CEPH_ARGS
11     CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
12     CEPH_ARGS+="--mon-host=$CEPH_MON "
13     set -e
14
15     local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
16     for func in $funcs ; do
17         setup $dir || return 1
18         $func $dir || return 1
19         teardown $dir || return 1
20     done
21 }
22
23 function TEST_minimal() {
24     local dir=$1
25
26     run_mon $dir a
27     run_mgr $dir x
28     run_osd $dir 0
29     run_osd $dir 1
30     run_osd $dir 2
31     create_rbd_pool
32     wait_for_clean
33 }
34
35 function TEST_multimon() {
36     local dir=$1
37
38     MONA="127.0.0.1:7224" # git grep '\<7224\>' : there must be only one
39     MONB="127.0.0.1:7225" # git grep '\<7225\>' : there must be only one
40     MONC="127.0.0.1:7226" # git grep '\<7226\>' : there must be only one
41
42     run_mon $dir a --public-addr $MONA
43     run_mon $dir b --public-addr $MONB
44     run_mon $dir c --public_addr $MONC
45     run_mgr $dir x
46     run_mgr $dir y
47     run_osd $dir 0
48     run_osd $dir 1
49     run_osd $dir 2
50
51     ceph osd pool create foo 32
52     ceph osd out 0
53     wait_for_clean
54
55     rados -p foo bench 4 write -b 4096 --no-cleanup
56     wait_for_clean
57
58     ceph osd in 0
59     flush_pg_stats
60     wait_for_clean
61 }
62
63 main smoke "$@"