Skip to content

Commit

Permalink
Merge PR ceph#31748 into master
Browse files Browse the repository at this point in the history
* refs/pull/31748/head:
	qa/standalone/test_ceph_daemon.sh: remove old vg before creating
	qa/standalone/test_ceph_daemon.sh: sudo for untar
	qa/standalone/test_ceph_daemon.sh: sudo for losetup etc
	qa/standalone/test_ceph_daemon.sh: fix overwrites of temp files

Reviewed-by: Michael Fritch <[email protected]>
  • Loading branch information
liewegas committed Nov 21, 2019
2 parents bb3a719 + 07193ae commit a68536b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qa/standalone/test_ceph_daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ $SUDO $CEPH_DAEMON --image $IMAGE_MASTER bootstrap \
--fsid $FSID \
--config $ORIG_CONFIG \
--output-config $CONFIG \
--output-keyring $KEYRING
--output-keyring $KEYRING \
--allow-overwrite
test -e $CONFIG
test -e $KEYRING
rm -f $ORIG_CONFIG
Expand Down Expand Up @@ -172,10 +173,11 @@ $SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \
# add osd.{1,2,..}
dd if=/dev/zero of=$TMPDIR/$OSD_IMAGE_NAME bs=1 count=0 seek=$OSD_IMAGE_SIZE
loop_dev=$(losetup -f)
losetup $loop_dev $TMPDIR/$OSD_IMAGE_NAME
pvcreate $loop_dev && vgcreate $OSD_VG_NAME $loop_dev
$SUDO vgremove -f $OSD_VG_NAME || true
$SUDO losetup $loop_dev $TMPDIR/$OSD_IMAGE_NAME
$SUDO pvcreate $loop_dev && $SUDO vgcreate $OSD_VG_NAME $loop_dev
for id in `seq 0 $((--OSD_TO_CREATE))`; do
lvcreate -l $((100/$OSD_TO_CREATE))%VG -n $OSD_LV_NAME.$id $OSD_VG_NAME
$SUDO lvcreate -l $((100/$OSD_TO_CREATE))%VG -n $OSD_LV_NAME.$id $OSD_VG_NAME
$SUDO $CEPH_DAEMON shell --config $CONFIG --keyring $KEYRING -- \
ceph orchestrator osd create \
$(hostname):/dev/$OSD_VG_NAME/$OSD_LV_NAME.$id
Expand All @@ -187,7 +189,7 @@ done
## adopt
for tarball in $TEST_TARS; do
TMP_TAR_DIR=`mktemp -d -p $TMPDIR`
tar xzvf $tarball -C $TMP_TAR_DIR
$SUDO tar xzvf $tarball -C $TMP_TAR_DIR
NAMES=$($SUDO $CEPH_DAEMON ls --legacy-dir $TMP_TAR_DIR | jq -r '.[].name')
for name in $NAMES; do
# TODO: skip osd test for now
Expand All @@ -206,7 +208,7 @@ for tarball in $TEST_TARS; do
done
# clean-up before next iter
$SUDO $CEPH_DAEMON rm-cluster --fsid $FSID_LEGACY --force
rm -rf $TMP_TAR_DIR
$SUDO rm -rf $TMP_TAR_DIR
done

## unit
Expand Down

0 comments on commit a68536b

Please sign in to comment.