Skip to content

Commit

Permalink
Add functional tests
Browse files Browse the repository at this point in the history
Signed-off-by: Luciano Lo Giudice <[email protected]>
  • Loading branch information
lmlg committed Sep 27, 2023
1 parent 02a8ee4 commit 4c94287
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tests/scripts/actionutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,28 @@ 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
loop_file="$(sudo mktemp -p /mnt XXXX.img)"
sudo truncate -s 1G "${loop_file}"
loop_dev="$(sudo losetup --show -f "${loop_file}")"
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}")"

# 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
minor="${loop_dev##/dev/loop}"
sudo mknod -m 0660 "/dev/sdi${l}" b 7 "${minor}"
sudo microceph disk add --wipe "/dev/sdi${l}" --encrypt
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}1" b 7 "${wal_minor}"
sudo mknod -m 0660 "/dev/sdi${l}2" b 7 "${db_minor}"
sudo microceph disk add --wipe "/dev/sdi${l}" --encrypt --wal-device "/dev/sdi${l}1" --wal-encrypt --wal-wipe --db-device "/dev/sdi${l}2" --db-wipe --db-encrypt
done

# Wait for OSDs to become up
Expand Down

0 comments on commit 4c94287

Please sign in to comment.