]> granicus.if.org Git - zfs/commitdiff
arc_summary: consolidate test case
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 13 Dec 2018 20:25:04 +0000 (12:25 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 6 Jan 2019 18:39:41 +0000 (10:39 -0800)
Since we're only installing one version of arc_summary we only
need one test case.  Update the test to determine which version
is available and then test its supported flags.

Remove files for misc tests which should have been cleaned up.

Reviewed-by: John Ramsden <johnramsden@riseup.net>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8096

scripts/zfs-tests.sh
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am
tests/zfs-tests/tests/functional/cli_user/misc/arc_summary3_001_pos.ksh [deleted file]
tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh

index cc80909ff9a454108867d485104ce62171f4d99c..f00a284847acf17b46ff0eb7ff01a58c9e694d6a 100755 (executable)
@@ -247,6 +247,10 @@ constrain_path() {
        ln -fs "$STF_PATH/gunzip" "$STF_PATH/uncompress"
        ln -fs "$STF_PATH/exportfs" "$STF_PATH/share"
        ln -fs "$STF_PATH/exportfs" "$STF_PATH/unshare"
+
+       if [ -L "$STF_PATH/arc_summary3" ]; then
+               ln -fs "$STF_PATH/arc_summary3" "$STF_PATH/arc_summary"
+       fi
 }
 
 #
index f33a9164940d29fa16d4f46d81999b415688447d..4463bfa1e71f9d7ae7f88e29983cf6271f75513c 100644 (file)
@@ -477,8 +477,7 @@ tests = ['zdb_001_neg', 'zfs_001_neg', 'zfs_allow_001_neg',
     'zpool_offline_001_neg', 'zpool_online_001_neg', 'zpool_remove_001_neg',
     'zpool_replace_001_neg', 'zpool_scrub_001_neg', 'zpool_set_001_neg',
     'zpool_status_001_neg', 'zpool_upgrade_001_neg', 'arcstat_001_pos',
-    'arc_summary_001_pos', 'arc_summary_002_neg',
-    'arc_summary3_001_pos', 'dbufstat_001_pos']
+    'arc_summary_001_pos', 'arc_summary_002_neg', 'dbufstat_001_pos']
 user =
 tags = ['functional', 'cli_user', 'misc']
 
index ff7b4906fe3a52edb9b4db4ac6dda39a605bbb8d..29c03429091bcf882226efbd308b3bc5ba83af51 100644 (file)
@@ -46,7 +46,6 @@ dist_pkgdata_SCRIPTS = \
        arcstat_001_pos.ksh \
        arc_summary_001_pos.ksh \
        arc_summary_002_neg.ksh \
-       arc_summary3_001_pos.ksh \
        dbufstat_001_pos.ksh
 
 dist_pkgdata_DATA = \
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary3_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary3_001_pos.ksh
deleted file mode 100755 (executable)
index ff090ba..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/ksh -p
-#
-# 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 (c) 2015 by Lawrence Livermore National Security, LLC.
-# All rights reserved.
-#
-
-. $STF_SUITE/include/libtest.shlib
-
-# Keep the following test until Python 3 is installed on all test systems,
-# then remove
-python3 -V 2>&1 > /dev/null
-if (( $? )); then
-        log_unsupported "Python3 is not installed"
-fi
-
-
-# Some systems have Python 3 installed, but only older versions that don't
-# have the subprocess.run() functionality. We catch these with a separate
-# test. Remove this when all systems have reached 3.5 or greater
-VERSIONPYTEST=$(python3 -V)
-if [[ ${VERSIONPYTEST:9:1} -lt 5 ]]; then
-        log_unsupported "Python3 must be version 3.5 or greater"
-fi
-
-
-set -A args  "" "-a" "-d" "-p 1" "-g" "-s arc" "-r"
-log_assert "arc_summary3 generates output and doesn't return an error code"
-
-typeset -i i=0
-while [[ $i -lt ${#args[*]} ]]; do
-        log_must eval "arc_summary3 ${args[i]} > /dev/null"
-        ((i = i + 1))
-done
-
-log_pass "arc_summary3 generates output and doesn't return an error code"
index 8736b18d84a117c7174cf6754977cf650058f202..a445fbb48cf38218cb1cf5ae195741cc1d56386f 100755 (executable)
 
 . $STF_SUITE/include/libtest.shlib
 
-set -A args  "" "-a" "-d" "-p 1"
-
 log_assert "arc_summary generates output and doesn't return an error code"
 
+# Depending on which version of arc_summary is installed some command
+# line options may not be available.  The python3 version includes
+# several additional flags.
+python3 -V 2>&1 > /dev/null
+if (( $? )); then
+       # Some systems have Python 3 installed, but only older versions
+       # that don't have the subprocess.run() functionality. We catch
+       # these with a separate test. Remove this when all systems have
+       # reached 3.5 or greater
+       VERSIONPYTEST=$(python3 -V)
+       if [[ ${VERSIONPYTEST:9:1} -lt 5 ]]; then
+               set -A args  "" "-a" "-d" "-p 1"
+       else
+               set -A args  "" "-a" "-d" "-p 1" "-g" "-s arc" "-r"
+       fi
+else
+       set -A args  "" "-a" "-d" "-p 1"
+fi
+
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-        log_must eval "arc_summary ${args[i]} > /dev/null"
-        ((i = i + 1))
+       log_must eval "arc_summary ${args[i]} > /dev/null"
+       ((i = i + 1))
 done
 
 log_must eval "arc_summary | head > /dev/null"
index 477b7ca08f358fe538a6ae6e21c78967df80009b..de747fba89d1a75116e7f0b48c747d94f379e5cf 100755 (executable)
@@ -27,7 +27,7 @@
 
 . $STF_SUITE/include/libtest.shlib
 
-typeset args=("-x" "-r" "-5" "-p 7" "--err" "-@")
+typeset args=("-x" "-5" "-p 7" "--err" "-@")
 
 log_assert "arc_summary generates an error code with invalid options"
 
index 874a9fd2d7c3c7cb8af482a44a2c535760fb39f7..e3dc8c179c0aafe1a4264838efc3e2bc7f161f82 100755 (executable)
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_user/misc/misc.cfg
 
-if poolexists $TESTPOOL.virt
-then
+if poolexists $TESTPOOL.virt; then
        log_must zpool destroy $TESTPOOL.virt
 fi
 
-if poolexists v1-pool
-then
+if poolexists v1-pool; then
        log_must zpool destroy v1-pool
 fi
 
-if [[ -f $TEST_BASE_DIR/zfstest_datastream.dat ]]
-then
-       log_must rm -f $TEST_BASE_DIR/zfstest_datastream.dat
-fi
+log_must rm -f $TEST_BASE_DIR/zfstest_datastream.dat
+log_must rm -f $TEST_BASE_DIR/disk1.dat $TEST_BASE_DIR/disk2.dat \
+    $TEST_BASE_DIR/disk3.dat $TEST_BASE_DIR/disk-additional.dat \
+    $TEST_BASE_DIR/disk-export.dat $TEST_BASE_DIR/disk-offline.dat \
+    $TEST_BASE_DIR/disk-spare1.dat $TEST_BASE_DIR/disk-spare2.dat
+log_must rm -f $TEST_BASE_DIR/zfs-pool-v1.dat \
+    $TEST_BASE_DIR/zfs-pool-v1.dat.bz2
 
 default_cleanup