Skip to content

Commit

Permalink
Merge pull request #4738 from dachary/wip-11618-osd-create-dup
Browse files Browse the repository at this point in the history
tests: ceph create may consume more than one id

Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed May 22, 2015
2 parents 4be8e49 + ab8e9e3 commit c2c36bc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
23 changes: 16 additions & 7 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -1036,17 +1036,26 @@ function test_mon_osd()

ceph osd create $uuid $gap_start 2>&1 | grep 'EINVAL'

#
# When CEPH_CLI_TEST_DUP_COMMAND is set, osd create
# is repeated and consumes two osd id, not just one.
#
local next_osd
if test "$CEPH_CLI_TEST_DUP_COMMAND" ; then
next_osd=$((gap_start + 1))
else
next_osd=$gap_start
fi
id=`ceph osd create`
[ "$id" = "$gap_start" ]
gap_start=$((gap_start + 1))
[ "$id" = "$next_osd" ]

next_osd=$((id + 1))
id=`ceph osd create $(uuidgen)`
[ "$id" = "$gap_start" ]
gap_start=$((gap_start + 1))
[ "$id" = "$next_osd" ]

id=`ceph osd create $(uuidgen) $gap_start`
[ "$id" = "$gap_start" ]
gap_start=$((gap_start + 1))
next_osd=$((id + 1))
id=`ceph osd create $(uuidgen) $next_osd`
[ "$id" = "$next_osd" ]

local new_osds=$(echo $(ceph osd ls))
for id in $(echo $new_osds | sed -e "s/$old_osds//") ; do
Expand Down
2 changes: 2 additions & 0 deletions src/test/cephtool-test-mds.sh
@@ -1,5 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
#
# Author: Loic Dachary <loic@dachary.org>
Expand All @@ -14,6 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
CEPH_CLI_TEST_DUP_COMMAND=1 \
MDS=1 MON=1 OSD=3 CEPH_START='mon osd mds' CEPH_PORT=7200 test/vstart_wrapper.sh \
../qa/workunits/cephtool/test.sh \
--test-mds \
Expand Down
2 changes: 2 additions & 0 deletions src/test/cephtool-test-mon.sh
@@ -1,5 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
#
# Author: Loic Dachary <loic@dachary.org>
Expand All @@ -14,6 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
CEPH_CLI_TEST_DUP_COMMAND=1 \
MON=3 OSD=3 CEPH_START='mon osd' CEPH_PORT=7202 test/vstart_wrapper.sh \
../qa/workunits/cephtool/test.sh \
--test-mon \
Expand Down
2 changes: 2 additions & 0 deletions src/test/cephtool-test-osd.sh
@@ -1,5 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
#
# Author: Loic Dachary <loic@dachary.org>
Expand All @@ -14,6 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
CEPH_CLI_TEST_DUP_COMMAND=1 \
MON=1 OSD=3 CEPH_START='mon osd' CEPH_PORT=7201 test/vstart_wrapper.sh \
../qa/workunits/cephtool/test.sh \
--test-osd \
Expand Down

0 comments on commit c2c36bc

Please sign in to comment.