From 7a298ae97589d758d2b9aadf78b91a2af450d37a Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Tue, 28 Jan 2020 11:36:33 -0500 Subject: [PATCH] ZTS: Eliminate random and shuf, consolidate code Both GNU and FreeBSD sort have -R to randomize input. Reviewed-by: John Kennedy Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #9900 --- tests/zfs-tests/include/commands.cfg | 2 -- tests/zfs-tests/include/libtest.shlib | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index 9d1fd8975..79f05e54a 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -123,7 +123,6 @@ export SYSTEM_FILES_FREEBSD='chflags mkfifo newfs pw - random rmextattr setextattr sha256 @@ -161,7 +160,6 @@ export SYSTEM_FILES_LINUX='attr setenforce setfattr sha256sum - shuf udevadm useradd userdel diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index d9ba374f2..9c089990b 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -3966,11 +3966,7 @@ function range_shuffle # begin end typeset -i begin=$1 typeset -i end=$2 - if is_freebsd; then - seq ${begin} ${end} | random -f - - else - shuf -i ${begin}-${end} - fi + seq ${begin} ${end} | sort -R } #