mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-05 16:32:44 +03:00

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
110 lines
4.3 KiB
Plaintext
110 lines
4.3 KiB
Plaintext
#
|
|
# CDDL HEADER START
|
|
#
|
|
# The contents of this file are subject to the terms of the
|
|
# Common Development and Distribution License (the "License").
|
|
# You may not use this file except in compliance with the License.
|
|
#
|
|
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
# or http://www.opensolaris.org/os/licensing.
|
|
# See the License for the specific language governing permissions
|
|
# and limitations under the License.
|
|
#
|
|
# When distributing Covered Code, include this CDDL HEADER in each
|
|
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
# If applicable, add the following below this CDDL HEADER, with the
|
|
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
#
|
|
# CDDL HEADER END
|
|
#
|
|
|
|
#
|
|
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
|
# Use is subject to license terms.
|
|
#
|
|
#
|
|
# For every configX.cfg file there must be a corresponding stateX.cfg
|
|
# file. The state file both drives the operations to be performed on the
|
|
# dataset hierarchy which has been specified by the corresponding
|
|
# configX.cfg file, and also specifies the expected state of the
|
|
# properties after the operation has been completed.
|
|
#
|
|
# The format of the file is:
|
|
# <target dataset>:<command>
|
|
# <property source before command> <property src after command>
|
|
# <property source before command> <property src after command>
|
|
# .... ....
|
|
# .... ....
|
|
#
|
|
# <target dataset> - dataset upon which the <command> is to be executed. Can
|
|
# be any of the datasets specified in the corresponding
|
|
# configX.cfg file. If no command is to be executed
|
|
# then must be set to '-'
|
|
#
|
|
#
|
|
# <command> - command to be executed upon the specified dataset.
|
|
# Currently the only supported commands are 'inherit'
|
|
# or 'inherit -r'. If no command is to be executed,
|
|
# then must be set to '-'.
|
|
#
|
|
# <property src before command>
|
|
# - the 'source' (as reported in 'zfs get') for the
|
|
# the properties before <command> is executed. This
|
|
# can be 'default', 'local' or the name of a dataset
|
|
# from which the property is inherited. (The code
|
|
# automatically adds in the 'inherited from..' part
|
|
# of the string when doing the check.
|
|
#
|
|
# This field is for informational purposes only, to
|
|
# aid the user in seeing how the changes trickle down
|
|
# the data hierarchy.
|
|
#
|
|
# <property src after command>
|
|
# - the expected value of the 'source' field after the
|
|
# <command> has been executed on the <target dataset>.
|
|
# As above can be 'default', 'local', or the dataset
|
|
# from which the property is inherited.
|
|
#
|
|
# Two important things to note:
|
|
# 1) there must be a <property src..> line corresponding to each dataset
|
|
# line specified in the configX.cfg file.
|
|
#
|
|
#
|
|
# 2) There can be as many <command>/<property src> blocks as desired, but
|
|
# there must be at least one, and the effect of each block is cumulative
|
|
# (i.e. the properties are not reset back to their default values between
|
|
# each block. If that is desired then each block must be placed in its
|
|
# own state file with its own corresponding configX.cfg file).
|
|
#
|
|
#
|
|
# Below are two sample <command>/<property src> blocks.
|
|
#
|
|
# The first simply verifies that the properties on the top level dataset
|
|
# were set locally, and that the middle and bottom datasets properties
|
|
# were inherited from the top level pool (called TESTPOOL). Note the '-:-'
|
|
# which means that no command is to be executed, but simply that the
|
|
# properties settings are to be verified.
|
|
#
|
|
|
|
#
|
|
# Copyright (c) 2013 by Delphix. All rights reserved.
|
|
#
|
|
|
|
-:-
|
|
#
|
|
local local
|
|
TESTPOOL TESTPOOL
|
|
TESTPOOL TESTPOOL
|
|
#
|
|
#
|
|
# The block below describes the expected state of the properties after
|
|
# an 'inherit -r' command has been run on the top level pool (called
|
|
# TESTPOOL).
|
|
#
|
|
TESTPOOL:inherit -r
|
|
#
|
|
local default
|
|
TESTPOOL default
|
|
TESTPOOL default
|