ZTS: Fix userquota_006_pos on FreeBSD

FreeBSD uses `pw` for account management. `userquota_006_pos`
erroneously invokes the non-existent `groupdel` command on FreeBSD.

Use `pw groupdel -n` instead of `groupdel` on FreeBSD.

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 #10032
This commit is contained in:
Ryan Moeller 2020-02-20 11:14:25 -05:00 committed by GitHub
parent b11375d74a
commit ca7ea23f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,11 @@ done
set -A no_groups "aidsf@dfsd@" "123223-dsfds#sdfsd" "mss_#ss" "1234" set -A no_groups "aidsf@dfsd@" "123223-dsfds#sdfsd" "mss_#ss" "1234"
for group in "${no_groups[@]}"; do for group in "${no_groups[@]}"; do
log_mustnot eval "groupdel $group > /dev/null 2>&1" if is_freebsd; then
log_mustnot eval "pw groupdel -n $group >/dev/null 2>&1"
else
log_mustnot eval "groupdel $group >/dev/null 2>&1"
fi
log_must eval "zfs get groupquota@$group $QFS >/dev/null 2>&1" log_must eval "zfs get groupquota@$group $QFS >/dev/null 2>&1"
log_must eval "zfs get groupquota@$group $snap_fs >/dev/null 2>&1" log_must eval "zfs get groupquota@$group $snap_fs >/dev/null 2>&1"
done done