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# 14# Copyright (c) 2018 by Nutanix. All rights reserved. 15# 16 17. $STF_SUITE/include/libtest.shlib 18. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg 19 20# 21# DESCRIPTION: 22# Make sure zpool import -d <device> works. 23# 24# STRATEGY: 25# 1. Create test pool A. 26# 2. Export pool A. 27# 3. Verify 'import -d <device>' works 28# 29 30verify_runnable "global" 31 32function cleanup 33{ 34 destroy_pool $TESTPOOL1 35 36 log_must rm $VDEV0 $VDEV1 37 log_must truncate -s $FILE_SIZE $VDEV0 $VDEV1 38} 39 40log_assert "Pool can be imported with '-d <device>'" 41log_onexit cleanup 42 43log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1 44log_must zpool export $TESTPOOL1 45 46log_must zpool import -d $VDEV0 -d $VDEV1 $TESTPOOL1 47log_must zpool export $TESTPOOL1 48 49# mix -d <dir> and -d <device> 50log_must mkdir $DEVICE_DIR/test_dir 51log_must ln -s $VDEV0 $DEVICE_DIR/test_dir/disk 52log_must zpool import -d $DEVICE_DIR/test_dir -d $VDEV1 $TESTPOOL1 53 54log_pass "Pool can be imported with '-d <device>'" 55