Skip to content

Commit

Permalink
Merge pull request #1500 from nalind/test-zfs
Browse files Browse the repository at this point in the history
Test zfs in CI
  • Loading branch information
giuseppe committed Feb 3, 2023
2 parents 4ad749f + c431c6b commit ad9b7d8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ ubuntu_testing_task: &ubuntu_testing
TEST_DRIVER: "fuse-overlay-whiteout"
- env:
TEST_DRIVER: "btrfs"
- env:
TEST_DRIVER: "zfs"


lint_task:
Expand Down
20 changes: 20 additions & 0 deletions contrib/cirrus/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ case $TEST_DRIVER in
mount -o loop $GOSRC/$TEST_DRIVER.img $tmpdir
TMPDIR="$tmpdir" showrun make STORAGE_DRIVER=$TEST_DRIVER local-test-integration local-test-unit
;;
zfs)
# Ubuntu: install zfsutils-linux
if ! check_filesystem_supported $TEST_DRIVER ; then
die "This CI VM does not support $TEST_DRIVER in its kernel"
fi
if test -z "$(which zpool 2> /dev/null)" ; then
die "This CI VM does not have zpool installed"
fi
if test -z "$(which zfs 2> /dev/null)" ; then
die "This CI VM does not have zfs installed"
fi
tmpfile=$(mktemp -p $GOSRC)
truncate -s 0 $tmpfile
fallocate -l 1G $tmpfile
zpool=$(basename $tmpfile)
zpool create $zpool $tmpfile
trap "zfs destroy -Rf $zpool/tmp; zpool destroy -f $zpool; rm -f $tmpfile" EXIT
zfs create $zpool/tmp
TMPDIR="/$zpool/tmp" showrun make STORAGE_DRIVER=$TEST_DRIVER local-test-integration local-test-unit
;;
*)
die "Unknown/Unsupported \$TEST_DRIVER=$TEST_DRIVER (see .cirrus.yml and $(basename $0))"
;;
Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ case "$OS_RELEASE_ID" in
[[ -z "$DEBS_CONFLICTING" ]] || \
$SHORT_APTGET -q remove $DEBS_CONFLICTING
$SHORT_APTGET -q update
$SHORT_APTGET -q install zstd
$SHORT_APTGET -q install zstd zfsutils-linux
;;
*)
bad_os_id_ver
Expand Down

0 comments on commit ad9b7d8

Please sign in to comment.