diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 1fb425df70..f9f2a706e7 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -107,8 +107,6 @@ ./test/images/volume/gluster/run_gluster.sh ./test/images/volume/iscsi/create_block.sh ./test/images/volume/nfs/run_nfs.sh -./test/images/volume/rbd/bootstrap.sh -./test/images/volume/rbd/create_block.sh ./third_party/forked/shell2junit/sh2ju.sh ./third_party/intemp/intemp.sh ./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh diff --git a/test/images/volume/rbd/bootstrap.sh b/test/images/volume/rbd/bootstrap.sh index fb5e69c210..8b8136f1e1 100755 --- a/test/images/volume/rbd/bootstrap.sh +++ b/test/images/volume/rbd/bootstrap.sh @@ -25,10 +25,10 @@ # Create /etc/ceph/ceph.conf -sh ./ceph.conf.sh `hostname -i` +sh ./ceph.conf.sh "$(hostname -i)" # Configure and start ceph-mon -sh ./mon.sh `hostname -i` +sh ./mon.sh "$(hostname -i)" # Configure and start 2x ceph-osd mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1 @@ -51,7 +51,7 @@ ceph fs new cephfs cephfs_metadata cephfs_data # It takes a while until the volume created above is mountable, # 1 second is usually enough, but try indefinetily. sleep 1 -while ! ceph-fuse -m `hostname -i`:6789 /mnt; do +while ! ceph-fuse -m "$(hostname -i):6789" /mnt; do echo "Waiting for cephfs to be up" sleep 1 done diff --git a/test/images/volume/rbd/create_block.sh b/test/images/volume/rbd/create_block.sh index 7d29aff1ea..258639e0eb 100755 --- a/test/images/volume/rbd/create_block.sh +++ b/test/images/volume/rbd/create_block.sh @@ -20,7 +20,7 @@ # Exit on the first error. set -e -MNTDIR=`mktemp -d` +MNTDIR="$(mktemp -d)" cleanup() { @@ -28,8 +28,8 @@ cleanup() RET=$? # Silently remove everything and ignore errors set +e - /bin/umount $MNTDIR 2>/dev/null - /bin/rmdir $MNTDIR 2>/dev/null + /bin/umount "$MNTDIR" 2>/dev/null + /bin/rmdir "$MNTDIR" 2>/dev/null /bin/rm block 2>/dev/null exit $RET } @@ -42,9 +42,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M mkfs.ext2 block # Add index.html to it -mount -o loop block $MNTDIR -echo "Hello from RBD" > $MNTDIR/index.html -umount $MNTDIR +mount -o loop block "$MNTDIR" +echo "Hello from RBD" > "$MNTDIR/index.html" +umount "$MNTDIR" rm block.tar.gz 2>/dev/null || : tar cfz block.tar.gz block