]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/standalone/mon/mon-handle-forward.sh
8633959d5f2a4a979e55688c3bccaa9ca99176a9
3 # Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
4 # Copyright (C) 2014,2015 Red Hat <contact@redhat.com>
6 # Author: Loic Dachary <loic@dachary.org>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU Library Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Library Public License for more details.
18 source $CEPH_ROOT/qa
/standalone
/ceph-helpers.sh
23 setup
$dir ||
return 1
30 CEPH_ARGS
+="--fsid=$FSID --auth-supported=none "
31 CEPH_ARGS
+="--mon-initial-members=a,b --mon-host=$MONA,$MONB "
32 run_mon
$dir a
--public-addr $MONA ||
return 1
33 run_mon
$dir b
--public-addr $MONB ||
return 1
36 timeout
360 ceph
--mon-host-override $MONA mon stat ||
return 1
37 # check that MONB is indeed a peon
38 ceph
--admin-daemon $
(get_asok_path mon.b
) mon_status |
39 grep '"peon"' ||
return 1
40 # when the leader ( MONA ) is used, there is no message forwarding
41 ceph
--mon-host-override $MONA osd pool create POOL1
12
42 CEPH_ARGS
='' ceph
--admin-daemon $
(get_asok_path mon.a
) log flush ||
return 1
43 grep 'mon_command(.*"POOL1"' $dir/mon.a.log ||
return 1
44 CEPH_ARGS
='' ceph
--admin-daemon $
(get_asok_path mon.b
) log flush ||
return 1
45 grep 'mon_command(.*"POOL1"' $dir/mon.b.log
&& return 1
46 # when the peon ( MONB ) is used, the message is forwarded to the leader
47 ceph
--mon-host-override $MONB osd pool create POOL2
12
48 CEPH_ARGS
='' ceph
--admin-daemon $
(get_asok_path mon.b
) log flush ||
return 1
49 grep 'forward_request.*mon_command(.*"POOL2"' $dir/mon.b.log ||
return 1
50 CEPH_ARGS
='' ceph
--admin-daemon $
(get_asok_path mon.a
) log flush ||
return 1
51 grep ' forward(mon_command(.*"POOL2"' $dir/mon.a.log ||
return 1
52 # forwarded messages must retain features from the original connection
53 features
=$
(sed -n -e 's|.*127.0.0.1:0.*accept features \([0-9][0-9]*\)|\1|p' < \
55 grep ' forward(mon_command(.*"POOL2".*con_features '$features $dir/mon.a.log ||
return 1
57 teardown
$dir ||
return 1
60 main mon-handle-forward
"$@"
63 # compile-command: "cd ../.. ; make -j4 TESTS=test/mon/mon-handle-forward.sh check"