3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright (c) 2016 by Delphix. All rights reserved.
17 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
21 # Try calling zfs.sync.destroy with various arguments that are not
22 # valid. The script should fail.
25 verify_runnable "global"
27 set -A progs "zfs.sync.destroy(\"foo\", \"bar\")" \
28 "zfs.sync.destroy(\"foo\", 12345)" \
29 "zfs.sync.destroy(12345)" \
30 "zfs.sync.destroy()" \
31 "zfs.sync.destroy{\"foo\", bar=true}" \
32 "zfs.sync.destroy{\"foo\", defer=12345}" \
33 "zfs.sync.destroy{\"foo\", defer=true, 12345}" \
34 "zfs.sync.destroy{\"foo\", defer=true, bar=12345}" \
35 "zfs.sync.destroy{\"foo\", bar=true, defer=true}" \
36 "zfs.sync.destroy{defer=true}" \
37 "zfs.sync.destroy{12345, defer=true}"
41 while (( i < ${#progs[*]} )); do
42 log_note "running program: ${progs[i]}"
43 # output should contain the usage message, which starts with "destroy{"
44 echo ${progs[i]} | log_mustnot_checkerror_program "destroy{" $TESTPOOL -
48 log_pass "Invalid arguments to zfs.sync.destroy generate errors."