1#!/bin/ksh -p
2#
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
6# 1.0 of the CDDL.
7#
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.
11#
12
13. $STF_SUITE/include/libtest.shlib
14. $STF_SUITE/tests/functional/userquota/userquota_common.kshlib
15
16#
17# DESCRIPTION:
18# Avoid allowing #11294/#13709 to recur a third time.
19#
20# So we hardcode a copy of a pool with this bug, try unlocking it,
21# and fail on error. Simple.
22
23function cleanup
24{
25	destroy_pool $POOLNAME
26	rm -f $FILEDEV
27}
28
29log_onexit cleanup
30
31FILEDEV="$TEST_BASE_DIR/userspace_13709"
32POOLNAME="testpool_13709"
33
34log_assert "ZFS should be able to unlock pools with #13709's failure mode"
35
36log_must bzcat $STF_SUITE/tests/functional/userquota/13709_reproducer.bz2 > $FILEDEV
37
38log_must zpool import -d $FILEDEV $POOLNAME
39
40echo -e 'password\npassword\n' | log_must zfs mount -al
41
42# Cleanup
43cleanup
44
45log_pass "#13709 not happening here"
46