5 # This file and its contents are supplied under the terms of the
6 # Common Development and Distribution License ("CDDL"), version 1.0.
7 # You may only use this file in accordance with the terms of version
10 # A full copy of the text of the CDDL should have accompanied this
11 # source. A copy of the CDDL is also available via the Internet at
12 # http://www.illumos.org/license/CDDL.
18 # Copyright (c) 2017 Datto, Inc. All rights reserved.
21 . $STF_SUITE/include/libtest.shlib
22 . $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
23 . $STF_SUITE/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
27 # 'zpool import' should import a pool with an encrypted dataset without
31 # 1. Create an encrypted pool
33 # 3. Attempt to import the pool
34 # 4. Verify the pool exists and the key is not loaded
37 verify_runnable "both"
41 destroy_pool $TESTPOOL1
43 log_must mkfile $FILE_SIZE $VDEV0
47 log_assert "'zpool import' should import a pool with an encrypted dataset" \
50 log_must eval "echo $PASSPHRASE | zpool create -O encryption=on" \
51 "-O keyformat=passphrase -O keylocation=prompt $TESTPOOL1 $VDEV0"
52 log_must zpool export $TESTPOOL1
53 log_must zpool import -d $DEVICE_DIR $TESTPOOL1
54 log_must poolexists $TESTPOOL1
55 log_must key_unavailable $TESTPOOL1
56 log_must unmounted $TESTPOOL1
58 log_pass "'zpool import' imports a pool with an encrypted dataset without" \