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) 2018 by Delphix. All rights reserved.
17 . $STF_SUITE/include/libtest.shlib
18 . $STF_SUITE/tests/functional/cli_root/zfs_wait/zfs_wait.kshlib
22 # 'zfs wait' works when waiting for checkpoint discard to complete.
26 # 2. Open a file descriptor pointing to that file.
28 # 4. Start a background process waiting for the delete queue to empty.
29 # 5. Verify that the command doesn't return immediately.
30 # 6. Close the open file descriptor.
31 # 7. Verify that the command returns soon after the descriptor is closed.
41 typeset -r TESTFILE="/$TESTPOOL/testfile"
46 log_must touch $TESTFILE
49 log_bkgrnd zfs wait -t deleteq $TESTPOOL
55 bkgrnd_proc_succeeded $pid
57 log_pass "'zfs wait -t discard' works."