From: Loic Dachary Date: Sat, 7 Mar 2015 15:10:15 +0000 (+0100) Subject: tests: ceph-disk.sh can be confused if there are two OSDs X-Git-Tag: v9.0.0~167^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbb6df525c17ddab7609c2e10225a24c20dc289a;p=ceph.git tests: ceph-disk.sh can be confused if there are two OSDs Replace the fragile extaction of the whoami file with an explicit uuid set for a given OSD. It can conveniently be translated back into an osd id with ceph osd create uuid if needed. Signed-off-by: Loic Dachary --- diff --git a/src/test/ceph-disk.sh b/src/test/ceph-disk.sh index 28be510ea4b6..ac876ddc36bb 100755 --- a/src/test/ceph-disk.sh +++ b/src/test/ceph-disk.sh @@ -202,11 +202,12 @@ function test_activate() { local to_prepare=$1 local to_activate=$2 local journal=$3 + local osd_uuid=$(uuidgen) $mkdir -p $OSD_DATA ./ceph-disk $CEPH_DISK_ARGS \ - prepare $to_prepare $journal || return 1 + prepare --osd-uuid $osd_uuid $to_prepare $journal || return 1 $timeout $TIMEOUT ./ceph-disk $CEPH_DISK_ARGS \ activate \ @@ -214,7 +215,7 @@ function test_activate() { $to_activate || return 1 $timeout $TIMEOUT ./ceph osd pool set $TEST_POOL size 1 || return 1 - local id=$($cat $OSD_DATA/ceph-?/whoami || $cat $to_activate/whoami) + local id=$(ceph osd create $osd_uuid) local weight=1 ./ceph osd crush add osd.$id $weight root=default host=localhost || return 1 echo FOO > $DIR/BAR