summaryrefslogtreecommitdiffstats
path: root/src/test/run-rbd-tests
blob: 82d106e90120e0c91989c65c8ee5913115841073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash -ex

# this should be run from the src directory in the ceph.git

CEPH_SRC=$(pwd)
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CEPH_SRC/.libs"
export PYTHONPATH="$CEPH_SRC/pybind:$CEPH_SRC/test/pybind"
PATH="$CEPH_SRC:$PATH"

recreate_pool() {
    POOL_NAME=$1
    PG_NUM=100
    ceph osd pool delete $POOL_NAME $POOL_NAME --yes-i-really-really-mean-it
    ceph osd pool create $POOL_NAME $PG_NUM
}

run_cli_tests() {
    recreate_pool rbd
    $CEPH_SRC/../qa/workunits/rbd/import_export.sh
    recreate_pool rbd
    $CEPH_SRC/../qa/workunits/rbd/copy.sh
}

run_api_tests() {
    # skip many_snaps since it takes several minutes
    nosetests -v test_rbd -e '.*many_snaps'
    # ceph_test_librbd creates its own pools
    ceph_test_librbd
}

run_admin_socket_tests() {
    recreate_pool rbd
    $CEPH_SRC/../qa/workunits/rbd/test_admin_socket.sh
}

ceph_test_cls_rbd
run_api_tests
run_cli_tests
run_admin_socket_tests

export RBD_CREATE_ARGS="--image-format 2"
run_cli_tests

for i in 0 1 5 13 29 109
do
    export RBD_FEATURES=$i
    run_api_tests
done

echo OK