mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-27 10:24:22 +03:00
ZTS: Eliminate random and shuf, consolidate code
Both GNU and FreeBSD sort have -R to randomize input. Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #9900
This commit is contained in:
parent
25df8fb42f
commit
7a298ae975
@ -123,7 +123,6 @@ export SYSTEM_FILES_FREEBSD='chflags
|
|||||||
mkfifo
|
mkfifo
|
||||||
newfs
|
newfs
|
||||||
pw
|
pw
|
||||||
random
|
|
||||||
rmextattr
|
rmextattr
|
||||||
setextattr
|
setextattr
|
||||||
sha256
|
sha256
|
||||||
@ -161,7 +160,6 @@ export SYSTEM_FILES_LINUX='attr
|
|||||||
setenforce
|
setenforce
|
||||||
setfattr
|
setfattr
|
||||||
sha256sum
|
sha256sum
|
||||||
shuf
|
|
||||||
udevadm
|
udevadm
|
||||||
useradd
|
useradd
|
||||||
userdel
|
userdel
|
||||||
|
@ -3966,11 +3966,7 @@ function range_shuffle # begin end
|
|||||||
typeset -i begin=$1
|
typeset -i begin=$1
|
||||||
typeset -i end=$2
|
typeset -i end=$2
|
||||||
|
|
||||||
if is_freebsd; then
|
seq ${begin} ${end} | sort -R
|
||||||
seq ${begin} ${end} | random -f -
|
|
||||||
else
|
|
||||||
shuf -i ${begin}-${end}
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user