Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test zfs in CI #1500

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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