diff options
author | Olaf Faaland <[email protected]> | 2017-02-13 15:30:22 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-02-13 15:30:22 -0800 |
commit | a454868b0c631bb37e4ffb7a0b7cd672c2ae4c22 (patch) | |
tree | 71bc0a5feb4a12f1ee08c581d6dd6e7a9059579b /tests/zfs-tests/include | |
parent | 6dd95a910a258c38f239785d7275cd93ab29da37 (diff) |
Use file-based pools for zpool_expand test 002 and enable it
Use -pH flags in get_pool_prop so that numeric properties such as size
can be compared. The zpool_expand test suite is currently the only one
which uses get_pool_prop for a numeric property.
Add TEMPFILE and TEMPFILE{0,1,2} to default.cfg for tests that must
build pools on top of files, such as this one where expansion is
necessary but the entries in DISKS may not point to entities that can be
expanded.
Base the pool used for testing on file-type VDEVs instead of using zvols
within an underlying pool, to avoid issues that come up when pools are
backed by other pools.
Remove shell variables EX_1GB and EX_2GB used to recognize correct expansion,
and instead calculate the appropriate values based on the variables used to
control file or volume size, org_size and exp_size. This change is also
made in test 001 although that test is not enabled because it depends on
FMA.
Finally, enable zpool_expand_002_pos.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes #5757
Diffstat (limited to 'tests/zfs-tests/include')
-rw-r--r-- | tests/zfs-tests/include/default.cfg.in | 7 | ||||
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/zfs-tests/include/default.cfg.in b/tests/zfs-tests/include/default.cfg.in index ef34d2b90..a3e4881df 100644 --- a/tests/zfs-tests/include/default.cfg.in +++ b/tests/zfs-tests/include/default.cfg.in @@ -26,6 +26,7 @@ # # Copyright (c) 2016 by Delphix. All rights reserved. +# Copyright (c) 2017 Lawrence Livermore National Security, LLC. # . $STF_SUITE/include/commands.cfg @@ -129,6 +130,12 @@ export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$ export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$ export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$ +# some temp files +export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$ +export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$ +export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$ +export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$ + export ZFSROOT= export TESTSNAP=testsnap$$ diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index da80407a9..4493d97cd 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -25,6 +25,7 @@ # Use is subject to license terms. # Copyright (c) 2012, 2015 by Delphix. All rights reserved. # Copyright 2016 Nexenta Systems, Inc. +# Copyright (c) 2017 Lawrence Livermore National Security, LLC. # . ${STF_TOOLS}/include/logapi.shlib @@ -1041,6 +1042,8 @@ function get_prop # property dataset # Simple function to get the specified property of pool. If unable to # get the property then exits. # +# Note property is in 'parsable' format (-p) +# function get_pool_prop # property pool { typeset prop_val @@ -1048,7 +1051,7 @@ function get_pool_prop # property pool typeset pool=$2 if poolexists $pool ; then - prop_val=$($ZPOOL get $prop $pool 2>/dev/null | $TAIL -1 | \ + prop_val=$($ZPOOL get -pH $prop $pool 2>/dev/null | $TAIL -1 | \ $AWK '{print $3}') if [[ $? -ne 0 ]]; then log_note "Unable to get $prop property for pool " \ |