zfs/config/user-commands.m4

173 lines
5.4 KiB
Plaintext
Raw Normal View History

Add the ZFS Test Suite Add the ZFS Test Suite and test-runner framework from illumos. This is a continuation of the work done by Turbo Fredriksson to port the ZFS Test Suite to Linux. While this work was originally conceived as a stand alone project integrating it directly with the ZoL source tree has several advantages: * Allows the ZFS Test Suite to be packaged in zfs-test package. * Facilitates easy integration with the CI testing. * Users can locally run the ZFS Test Suite to validate ZFS. This testing should ONLY be done on a dedicated test system because the ZFS Test Suite in its current form is destructive. * Allows the ZFS Test Suite to be run directly in the ZoL source tree enabled developers to iterate quickly during development. * Developers can easily add/modify tests in the framework as features are added or functionality is changed. The tests will then always be in sync with the implementation. Full documentation for how to run the ZFS Test Suite is available in the tests/README.md file. Warning: This test suite is designed to be run on a dedicated test system. It will make modifications to the system including, but not limited to, the following. * Adding new users * Adding new groups * Modifying the following /proc files: * /proc/sys/kernel/core_pattern * /proc/sys/kernel/core_uses_pid * Creating directories under / Notes: * Not all of the test cases are expected to pass and by default these test cases are disabled. The failures are primarily due to assumption made for illumos which are invalid under Linux. * When updating these test cases it should be done in as generic a way as possible so the patch can be submitted back upstream. Most existing library functions have been updated to be Linux aware, and the following functions and variables have been added. * Functions: * is_linux - Used to wrap a Linux specific section. * block_device_wait - Waits for block devices to be added to /dev/. * Variables: Linux Illumos * ZVOL_DEVDIR "/dev/zvol" "/dev/zvol/dsk" * ZVOL_RDEVDIR "/dev/zvol" "/dev/zvol/rdsk" * DEV_DSKDIR "/dev" "/dev/dsk" * DEV_RDSKDIR "/dev" "/dev/rdsk" * NEWFS_DEFAULT_FS "ext2" "ufs" * Many of the disabled test cases fail because 'zfs/zpool destroy' returns EBUSY. This is largely causes by the asynchronous nature of device handling on Linux and is expected, the impacted test cases will need to be updated to handle this. * There are several test cases which have been disabled because they can trigger a deadlock. A primary example of this is to recursively create zpools within zpools. These tests have been disabled until the root issue can be addressed. * Illumos specific utilities such as (mkfile) should be added to the tests/zfs-tests/cmd/ directory. Custom programs required by the test scripts can also be added here. * SELinux should be either is permissive mode or disabled when running the tests. The test cases should be updated to conform to a standard policy. * Redundant test functionality has been removed (zfault.sh). * Existing test scripts (zconfig.sh) should be migrated to use the framework for consistency and ease of testing. * The DISKS environment variable currently only supports loopback devices because of how the ZFS Test Suite expects partitions to be named (p1, p2, etc). Support must be added to generate the correct partition name based on the device location and name. * The ZFS Test Suite is part of the illumos code base at: https://github.com/illumos/illumos-gate/tree/master/usr/src/test Original-patch-by: Turbo Fredriksson <turbo@bayour.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Olaf Faaland <faaland1@llnl.gov> Closes #6 Closes #1534
2015-07-01 22:23:09 +00:00
dnl #
dnl # Commands common to multiple platforms. They generally behave
dnl # in the same way and take similar options.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_COMMON], [
AC_PATH_TOOL(AWK, awk, "")
AC_PATH_TOOL(BASENAME, basename, "")
AC_PATH_TOOL(BC, bc, "")
AC_PATH_TOOL(BUNZIP2, bunzip2, "")
AC_PATH_TOOL(BZCAT, bzcat, "")
AC_PATH_TOOL(CAT, cat, "")
AC_PATH_TOOL(CD, cd, "cd") dnl # Builtin in bash
AC_PATH_TOOL(CHGRP, chgrp, "")
AC_PATH_TOOL(CHMOD, chmod, "")
AC_PATH_TOOL(CHOWN, chown, "")
AC_PATH_TOOL(CKSUM, cksum, "")
AC_PATH_TOOL(CMP, cmp, "")
AC_PATH_TOOL(CP, cp, "")
AC_PATH_TOOL(CPIO, cpio, "")
AC_PATH_TOOL(CUT, cut, "")
AC_PATH_TOOL(DATE, date, "")
AC_PATH_TOOL(DD, dd, "")
AC_PATH_TOOL(DF, df, "")
AC_PATH_TOOL(DIFF, diff, "")
AC_PATH_TOOL(DIRNAME, dirname, "")
AC_PATH_TOOL(DU, du, "")
AC_PATH_TOOL(ECHO, echo, "")
AC_PATH_TOOL(EGREP, egrep, "")
AC_PATH_TOOL(FDISK, fdisk, "")
AC_PATH_TOOL(FGREP, fgrep, "")
AC_PATH_TOOL(FILE, file, "")
AC_PATH_TOOL(FIND, find, "")
AC_PATH_TOOL(FSCK, fsck, "")
AC_PATH_TOOL(GNUDD, dd, "")
AC_PATH_TOOL(GETCONF, getconf, "")
AC_PATH_TOOL(GETENT, getent, "")
AC_PATH_TOOL(GREP, grep, "")
dnl # Due to permissions unpriviledged users may not detect group*.
AC_PATH_TOOL(GROUPADD, groupadd, "/usr/sbin/groupadd")
AC_PATH_TOOL(GROUPDEL, groupdel, "/usr/sbin/groupdel")
AC_PATH_TOOL(GROUPMOD, groupmod, "/usr/sbin/groupmod")
AC_PATH_TOOL(HEAD, head, "")
AC_PATH_TOOL(HOSTNAME, hostname, "")
AC_PATH_TOOL(ID, id, "")
AC_PATH_TOOL(KILL, kill, "")
AC_PATH_TOOL(KSH, ksh, "")
AC_PATH_TOOL(LOGNAME, logname, "")
AC_PATH_TOOL(LS, ls, "")
AC_PATH_TOOL(MD5SUM, md5sum, "")
AC_PATH_TOOL(MKDIR, mkdir, "")
AC_PATH_TOOL(MKNOD, mknod, "")
AC_PATH_TOOL(MKTEMP, mktemp, "")
AC_PATH_TOOL(MODINFO, modinfo, "")
AC_PATH_TOOL(MOUNT, mount, "")
AC_PATH_TOOL(MV, mv, "")
AC_PATH_TOOL(NAWK, nawk, "")
AC_PATH_TOOL(PGREP, pgrep, "")
AC_PATH_TOOL(PING, ping, "")
AC_PATH_TOOL(PKILL, pkill, "")
AC_PATH_TOOL(PRINTF, printf, "")
AC_PATH_TOOL(PS, ps, "")
AC_PATH_TOOL(PYTHON, python, "")
AC_PATH_TOOL(REBOOT, reboot, "")
AC_PATH_TOOL(RMDIR, rmdir, "")
AC_PATH_TOOL(RSH, rsh, "")
AC_PATH_TOOL(SED, sed, "")
AC_PATH_TOOL(SHUF, shuf, "")
AC_PATH_TOOL(SLEEP, sleep, "")
AC_PATH_TOOL(SORT, sort, "")
OpenZFS 2605, 6980, 6902 2605 want to resume interrupted zfs send Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Xin Li <delphij@freebsd.org> Reviewed by: Arne Jansen <sensille@gmx.net> Approved by: Dan McDonald <danmcd@omniti.com> Ported-by: kernelOfTruth <kerneloftruth@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/2605 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9c3fd12 6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Ported by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/6980 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ea4a67f Porting notes: - All rsend and snapshop tests enabled and updated for Linux. - Fix misuse of input argument in traverse_visitbp(). - Fix ISO C90 warnings and errors. - Fix gcc 'missing braces around initializer' in 'struct send_thread_arg to_arg =' warning. - Replace 4 argument fletcher_4_native() with 3 argument version, this change was made in OpenZFS 4185 which has not been ported. - Part of the sections for 'zfs receive' and 'zfs send' was rewritten and reordered to approximate upstream. - Fix mktree xattr creation, 'user.' prefix required. - Minor fixes to newly enabled test cases - Long holds for volumes allowed during receive for minor registration.
2016-01-06 21:22:48 +00:00
AC_PATH_TOOL(STAT, stat, "")
Add the ZFS Test Suite Add the ZFS Test Suite and test-runner framework from illumos. This is a continuation of the work done by Turbo Fredriksson to port the ZFS Test Suite to Linux. While this work was originally conceived as a stand alone project integrating it directly with the ZoL source tree has several advantages: * Allows the ZFS Test Suite to be packaged in zfs-test package. * Facilitates easy integration with the CI testing. * Users can locally run the ZFS Test Suite to validate ZFS. This testing should ONLY be done on a dedicated test system because the ZFS Test Suite in its current form is destructive. * Allows the ZFS Test Suite to be run directly in the ZoL source tree enabled developers to iterate quickly during development. * Developers can easily add/modify tests in the framework as features are added or functionality is changed. The tests will then always be in sync with the implementation. Full documentation for how to run the ZFS Test Suite is available in the tests/README.md file. Warning: This test suite is designed to be run on a dedicated test system. It will make modifications to the system including, but not limited to, the following. * Adding new users * Adding new groups * Modifying the following /proc files: * /proc/sys/kernel/core_pattern * /proc/sys/kernel/core_uses_pid * Creating directories under / Notes: * Not all of the test cases are expected to pass and by default these test cases are disabled. The failures are primarily due to assumption made for illumos which are invalid under Linux. * When updating these test cases it should be done in as generic a way as possible so the patch can be submitted back upstream. Most existing library functions have been updated to be Linux aware, and the following functions and variables have been added. * Functions: * is_linux - Used to wrap a Linux specific section. * block_device_wait - Waits for block devices to be added to /dev/. * Variables: Linux Illumos * ZVOL_DEVDIR "/dev/zvol" "/dev/zvol/dsk" * ZVOL_RDEVDIR "/dev/zvol" "/dev/zvol/rdsk" * DEV_DSKDIR "/dev" "/dev/dsk" * DEV_RDSKDIR "/dev" "/dev/rdsk" * NEWFS_DEFAULT_FS "ext2" "ufs" * Many of the disabled test cases fail because 'zfs/zpool destroy' returns EBUSY. This is largely causes by the asynchronous nature of device handling on Linux and is expected, the impacted test cases will need to be updated to handle this. * There are several test cases which have been disabled because they can trigger a deadlock. A primary example of this is to recursively create zpools within zpools. These tests have been disabled until the root issue can be addressed. * Illumos specific utilities such as (mkfile) should be added to the tests/zfs-tests/cmd/ directory. Custom programs required by the test scripts can also be added here. * SELinux should be either is permissive mode or disabled when running the tests. The test cases should be updated to conform to a standard policy. * Redundant test functionality has been removed (zfault.sh). * Existing test scripts (zconfig.sh) should be migrated to use the framework for consistency and ease of testing. * The DISKS environment variable currently only supports loopback devices because of how the ZFS Test Suite expects partitions to be named (p1, p2, etc). Support must be added to generate the correct partition name based on the device location and name. * The ZFS Test Suite is part of the illumos code base at: https://github.com/illumos/illumos-gate/tree/master/usr/src/test Original-patch-by: Turbo Fredriksson <turbo@bayour.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Olaf Faaland <faaland1@llnl.gov> Closes #6 Closes #1534
2015-07-01 22:23:09 +00:00
AC_PATH_TOOL(STRINGS, strings, "")
AC_PATH_TOOL(SU, su, "")
AC_PATH_TOOL(SUM, sum, "")
AC_PATH_TOOL(SYNC, sync, "")
AC_PATH_TOOL(TAIL, tail, "")
AC_PATH_TOOL(TAR, tar, "")
AC_PATH_TOOL(TOUCH, touch, "")
AC_PATH_TOOL(TR, tr, "")
OpenZFS 2605, 6980, 6902 2605 want to resume interrupted zfs send Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Xin Li <delphij@freebsd.org> Reviewed by: Arne Jansen <sensille@gmx.net> Approved by: Dan McDonald <danmcd@omniti.com> Ported-by: kernelOfTruth <kerneloftruth@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/2605 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9c3fd12 6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Ported by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/6980 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ea4a67f Porting notes: - All rsend and snapshop tests enabled and updated for Linux. - Fix misuse of input argument in traverse_visitbp(). - Fix ISO C90 warnings and errors. - Fix gcc 'missing braces around initializer' in 'struct send_thread_arg to_arg =' warning. - Replace 4 argument fletcher_4_native() with 3 argument version, this change was made in OpenZFS 4185 which has not been ported. - Part of the sections for 'zfs receive' and 'zfs send' was rewritten and reordered to approximate upstream. - Fix mktree xattr creation, 'user.' prefix required. - Minor fixes to newly enabled test cases - Long holds for volumes allowed during receive for minor registration.
2016-01-06 21:22:48 +00:00
AC_PATH_TOOL(TRUNCATE, truncate, "")
Add the ZFS Test Suite Add the ZFS Test Suite and test-runner framework from illumos. This is a continuation of the work done by Turbo Fredriksson to port the ZFS Test Suite to Linux. While this work was originally conceived as a stand alone project integrating it directly with the ZoL source tree has several advantages: * Allows the ZFS Test Suite to be packaged in zfs-test package. * Facilitates easy integration with the CI testing. * Users can locally run the ZFS Test Suite to validate ZFS. This testing should ONLY be done on a dedicated test system because the ZFS Test Suite in its current form is destructive. * Allows the ZFS Test Suite to be run directly in the ZoL source tree enabled developers to iterate quickly during development. * Developers can easily add/modify tests in the framework as features are added or functionality is changed. The tests will then always be in sync with the implementation. Full documentation for how to run the ZFS Test Suite is available in the tests/README.md file. Warning: This test suite is designed to be run on a dedicated test system. It will make modifications to the system including, but not limited to, the following. * Adding new users * Adding new groups * Modifying the following /proc files: * /proc/sys/kernel/core_pattern * /proc/sys/kernel/core_uses_pid * Creating directories under / Notes: * Not all of the test cases are expected to pass and by default these test cases are disabled. The failures are primarily due to assumption made for illumos which are invalid under Linux. * When updating these test cases it should be done in as generic a way as possible so the patch can be submitted back upstream. Most existing library functions have been updated to be Linux aware, and the following functions and variables have been added. * Functions: * is_linux - Used to wrap a Linux specific section. * block_device_wait - Waits for block devices to be added to /dev/. * Variables: Linux Illumos * ZVOL_DEVDIR "/dev/zvol" "/dev/zvol/dsk" * ZVOL_RDEVDIR "/dev/zvol" "/dev/zvol/rdsk" * DEV_DSKDIR "/dev" "/dev/dsk" * DEV_RDSKDIR "/dev" "/dev/rdsk" * NEWFS_DEFAULT_FS "ext2" "ufs" * Many of the disabled test cases fail because 'zfs/zpool destroy' returns EBUSY. This is largely causes by the asynchronous nature of device handling on Linux and is expected, the impacted test cases will need to be updated to handle this. * There are several test cases which have been disabled because they can trigger a deadlock. A primary example of this is to recursively create zpools within zpools. These tests have been disabled until the root issue can be addressed. * Illumos specific utilities such as (mkfile) should be added to the tests/zfs-tests/cmd/ directory. Custom programs required by the test scripts can also be added here. * SELinux should be either is permissive mode or disabled when running the tests. The test cases should be updated to conform to a standard policy. * Redundant test functionality has been removed (zfault.sh). * Existing test scripts (zconfig.sh) should be migrated to use the framework for consistency and ease of testing. * The DISKS environment variable currently only supports loopback devices because of how the ZFS Test Suite expects partitions to be named (p1, p2, etc). Support must be added to generate the correct partition name based on the device location and name. * The ZFS Test Suite is part of the illumos code base at: https://github.com/illumos/illumos-gate/tree/master/usr/src/test Original-patch-by: Turbo Fredriksson <turbo@bayour.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Olaf Faaland <faaland1@llnl.gov> Closes #6 Closes #1534
2015-07-01 22:23:09 +00:00
AC_PATH_TOOL(TRUE, true, "")
AC_PATH_TOOL(UMASK, umask, "")
AC_PATH_TOOL(UMOUNT, umount, "")
AC_PATH_TOOL(UNAME, uname, "")
AC_PATH_TOOL(UNIQ, uniq, "")
dnl # Due to permissions unpriviledged users may not detect user*.
AC_PATH_TOOL(USERADD, useradd, "/usr/sbin/useradd")
AC_PATH_TOOL(USERDEL, userdel, "/usr/sbin/userdel")
AC_PATH_TOOL(USERMOD, usermod, "/usr/sbin/usermod")
AC_PATH_TOOL(WAIT, wait, "wait") dnl # Builtin in bash
AC_PATH_TOOL(WC, wc, "")
])
dnl #
dnl # Linux commands, used withing 'is_linux' blocks of test scripts.
dnl # These commands may take different command line arguments.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_LINUX], [
AC_PATH_TOOL(BLOCKDEV, blockdev, "")
AC_PATH_TOOL(COMPRESS, gzip, "")
AC_PATH_TOOL(FORMAT, parted, "")
AC_PATH_TOOL(LOCKFS, lsof, "")
AC_PATH_TOOL(MODUNLOAD, rmmod, "")
AC_PATH_TOOL(NEWFS, mke2fs, "")
AC_PATH_TOOL(PFEXEC, sudo, "")
AC_PATH_TOOL(SHARE, exportfs, "")
AC_PATH_TOOL(SWAP, swapon, "")
AC_PATH_TOOL(SWAPADD, swapon, "")
AC_PATH_TOOL(UDEVADM, udevadm, "")
AC_PATH_TOOL(UFSDUMP, dump, "")
AC_PATH_TOOL(UFSRESTORE, restore, "")
AC_PATH_TOOL(UNCOMPRESS, gunzip, "")
AC_PATH_TOOL(UNSHARE, exportfs, "")
AC_PATH_TOOL(GETFACL, getfacl, "")
AC_PATH_TOOL(SETFACL, setfacl, "")
AC_PATH_TOOL(CHACL, chacl, "")
AC_PATH_TOOL(NPROC, nproc, "")
PAGESIZE=$($GETCONF PAGESIZE)
AC_SUBST(PAGESIZE)
MNTTAB=/etc/mtab
AC_SUBST(MNTTAB)
])
dnl #
dnl # BSD style commands, these have been kept in case at some point
dnl # we want to build these packages on a BSD style systems. Otherwise
dnl # they are unused and should be treated as such.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_BSD], [
AC_PATH_TOOL(COMPRESS, compress, "")
AC_PATH_TOOL(COREADM, coreadm, "")
AC_PATH_TOOL(DIRCMP, dircmp, "")
AC_PATH_TOOL(DUMPADM, dumpadm, "")
AC_PATH_TOOL(FORMAT, format, "")
AC_PATH_TOOL(GETMAJOR, getmajor, "")
AC_PATH_TOOL(ISAINFO, isainfo, "")
AC_PATH_TOOL(KSTAT, kstat, "")
AC_PATH_TOOL(LOCKFS, lockfs, "")
AC_PATH_TOOL(LOFIADM, lofiadm, "")
AC_PATH_TOOL(MODUNLOAD, modunload, "")
AC_PATH_TOOL(NEWFS, newfs, "")
AC_PATH_TOOL(PAGESIZE, pagesize, "")
AC_PATH_TOOL(PFEXEC, pfexec, "")
AC_PATH_TOOL(PKGINFO, pkginfo, "")
AC_PATH_TOOL(PRTVTOC, prtvtoc, "")
AC_PATH_TOOL(PSRINFO, psrinfo, "")
AC_PATH_TOOL(SHARE, share, "")
AC_PATH_TOOL(SVCADM, svcadm, "")
AC_PATH_TOOL(SVCS, svcs, "")
AC_PATH_TOOL(SWAP, swap, "")
AC_PATH_TOOL(SWAPADD, swapadd, "")
AC_PATH_TOOL(UFSDUMP, ufsdump, "")
AC_PATH_TOOL(UFSRESTORE, ufsrestore, "")
AC_PATH_TOOL(UMOUNTALL, umountall, "")
AC_PATH_TOOL(UNCOMPRESS, uncompress, "")
AC_PATH_TOOL(UNSHARE, unshare, "")
AC_PATH_TOOL(ZONEADM, zoneadm, "")
AC_PATH_TOOL(ZONECFG, zonecfg, "")
AC_PATH_TOOL(ZONENAME, zonename, "")
])
AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS], [
ZFS_AC_CONFIG_USER_COMMANDS_COMMON
OS=$($UNAME -o)
AS_IF([test "$OS" == "GNU/Linux"], [
ZFS_AC_CONFIG_USER_COMMANDS_LINUX
], [
ZFS_AC_CONFIG_USER_COMMANDS_BSD
])
])