diff --git a/tests/scripts/actionutils.sh b/tests/scripts/actionutils.sh index e03741d7..17477155 100755 --- a/tests/scripts/actionutils.sh +++ b/tests/scripts/actionutils.sh @@ -40,28 +40,16 @@ function add_encrypted_osds() { # Add OSDs backed by loop devices on /mnt (ephemeral "large" disk attached to GitHub action runners) i=0 for l in a b c; do - data_file="$(sudo mktemp -p /mnt data.XXXX.img)" - sudo truncate -s 1G "${data_file}" - data_dev="$(sudo losetup --show -f "${data_file}")" - - wal_file="$(sudo mktemp -p /mnt wal.XXXX.img)" - sudo truncate -s 1G "${wal_file}" - wal_dev="$(sudo losetup --show -f "${wal_file}")" - - db_file="$(sudo mktemp -p /mnt db.XXXX.img)" - sudo truncate -s 1G "${db_file}" - db_dev="$(sudo losetup --show -f "${db_file}")" + loop_file="$(sudo mktemp -p /mnt XXXX.img)" + sudo truncate -s 1G "${loop_file}" + loop_dev="$(sudo losetup --show -f "${loop_file}")" # XXX: the block-devices plug doesn't allow accessing /dev/loopX # devices so we make those same devices available under alternate # names (/dev/sdiY) that are not used inside GitHub Action runners - data_minor="${data_dev##/dev/loop}" - wal_minor="${wal_dev##/dev/loop}" - db_minor="${db_dev##/dev/loop}" - sudo mknod -m 0660 "/dev/sdi${l}" b 7 "${data_minor}" - sudo mknod -m 0660 "/dev/sdi${l}x" b 7 "${wal_minor}" - sudo mknod -m 0660 "/dev/sdi${l}y" b 7 "${db_minor}" - sudo microceph disk add "/dev/sdi${l}" --wipe --encrypt --wal-device "/dev/sdi${l}x" --wal-wipe --wal-encrypt --db-device "/dev/sdi${l}y" --db-wipe --db-encrypt + minor="${loop_dev##/dev/loop}" + sudo mknod -m 0660 "/dev/sdi${l}" b 7 "${minor}" + sudo microceph disk add --wipe "/dev/sdi${l}" --encrypt done # Wait for OSDs to become up