blob: b489d43192e0cd53c98088ad08829b92aece8fe9 (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
#!/usr/bin/env bash
#
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
function run() {
local dir=$1
shift
export CEPH_MON_V1="v1:127.0.0.1:7148" # git grep '\<7148\>' : there must be only one
export CEPH_MON_V2="v2:127.0.0.1:7149" # git grep '\<7149\>' : there must be only one
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
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_v1_osd_addrs() {
local dir=$1
export CEPH_ARGS="$CEPH_ARGS --mon-host=$CEPH_MON_V1 --mon-debug-no-require-nautilus"
run_mon $dir a || return 1
ceph mon dump | grep mon.a | grep $CEPH_MON_V1
run_osd $dir 0 || return 1
wait_for_osd up 0 || return 1
ceph osd dump | grep osd.0 | grep v1: || return 1
ceph osd dump | grep osd.0 | grep v2: && return 1
ceph osd require-osd-release nautilus
ceph osd down 0
wait_for_osd up 0 || return 1
# public should be v1, cluster v2
ceph osd dump | grep osd.0 | grep v1: || return 1
ceph osd dump -f json | jq '.osds[0].public_addrs.addrvec[0]' | grep v1 || return 1
ceph osd dump -f json | jq '.osds[0].cluster_addrs.addrvec[0]' | grep v2 || return 1
# enable v2 port on mon
ceph mon set-addrs a "[$CEPH_MON_V2,$CEPH_MON_V1]"
ceph osd down 0
wait_for_osd up 0 || return 1
# both public and cluster should be v2+v1
ceph osd dump | grep osd.0 | grep v1: || return 1
ceph osd dump -f json | jq '.osds[0].public_addrs.addrvec[0]' | grep v2 || return 1
ceph osd dump -f json | jq '.osds[0].cluster_addrs.addrvec[0]' | grep v2 || return 1
}
function TEST_mon_v2v1_osd_addrs() {
local dir=$1
export CEPH_ARGS="$CEPH_ARGS --mon-host=[$CEPH_MON_V2,$CEPH_MON_V1] --mon-debug-no-require-nautilus"
run_mon $dir a || return 1
ceph mon dump | grep mon.a | grep $CEPH_MON_V1
run_osd $dir 0 || return 1
wait_for_osd up 0 || return 1
ceph osd dump | grep osd.0 | grep v1: || return 1
ceph osd dump | grep osd.0 | grep v2: && return 1
ceph osd require-osd-release nautilus
ceph osd down 0
wait_for_osd up 0 || return 1
# both public and cluster should be v2+v1
ceph osd dump | grep osd.0 | grep v1: || return 1
ceph osd dump -f json | jq '.osds[0].public_addrs.addrvec[0]' | grep v2 || return 1
ceph osd dump -f json | jq '.osds[0].cluster_addrs.addrvec[0]' | grep v2 || return 1
}
main msgr-v2-transition "$@"
|