aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorScot W. Stevenson <[email protected]>2018-02-28 17:52:34 +0100
committerBrian Behlendorf <[email protected]>2018-02-28 08:52:34 -0800
commit19528cf9490bf4519d70028cc794e438303baf12 (patch)
treef8e897b847a03f70457690848b7dbccd70daacc8 /tests/zfs-tests
parent3e9c9d8a89c8665fc585db88fa911ce60533e79f (diff)
Add Python 3 rewrite of arc_summary.py
Add new script arc_summary3.py as a complete rewrite of the arc_summary.py tool (see issue #6873) Add new options: -g/--graph - Display crude graphic representation of ARC status and quit -r/--raw - Print all available information as minimally formatted list (for grep) -s/--section - Print a single section. This replaces -p/--page, which is kept for backwards use but marked as depreciated Add new sections with information on ZIL and SPL. Notify user if sections L2ARC and VDEV are skipped instead of failing silently. Add warning that -p/--page option is depreciated. Developed for Python 3.5. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Richard Elling <[email protected]> Reviewed by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Scot W. Stevenson <[email protected]> Closes #6873 Closes #6892
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r--tests/zfs-tests/include/commands.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am1
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/arc_summary3_001_pos.ksh56
3 files changed, 59 insertions, 0 deletions
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg
index 47926abfa..0600fe71c 100644
--- a/tests/zfs-tests/include/commands.cfg
+++ b/tests/zfs-tests/include/commands.cfg
@@ -91,6 +91,7 @@ export SYSTEM_FILES='arp
ps
pwd
python
+ python3
quotaon
readlink
rm
@@ -143,6 +144,7 @@ export ZFS_FILES='zdb
ztest
raidz_test
arc_summary.py
+ arc_summary3.py
arcstat.py
dbufstat.py
zed
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am b/tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am
index 75a3d0886..e1b52a1a3 100644
--- a/tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/Makefile.am
@@ -47,4 +47,5 @@ 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
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
new file mode 100755
index 000000000..22dceaaf4
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary3_001_pos.ksh
@@ -0,0 +1,56 @@
+#! /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.py generates output and doesn't return an error code"
+
+typeset -i i=0
+while [[ $i -lt ${#args[*]} ]]; do
+ log_must eval "arc_summary3.py ${args[i]} > /dev/null"
+ ((i = i + 1))
+done
+
+log_pass "arc_summary3.py generates output and doesn't return an error code"