1#! /bin/ksh -p 2# SPDX-License-Identifier: CDDL-1.0 3# 4# CDDL HEADER START 5# 6# This file and its contents are supplied under the terms of the 7# Common Development and Distribution License ("CDDL"), version 1.0. 8# You may only use this file in accordance with the terms of version 9# 1.0 of the CDDL. 10# 11# A full copy of the text of the CDDL should have accompanied this 12# source. A copy of the CDDL is also available via the Internet at 13# http://www.illumos.org/license/CDDL. 14# 15# CDDL HEADER END 16# 17 18# 19# Copyright (c) 2014, 2017 by Delphix. All rights reserved. 20# 21 22. $STF_SUITE/include/libtest.shlib 23. $STF_SUITE/tests/functional/removal/removal.kshlib 24 25default_setup_noexit "$DISKS" 26log_must zfs set compression=off $TESTPOOL 27log_onexit default_cleanup_noexit 28 29function callback 30{ 31 test_removal_with_operation_kill 32 log_must zpool export $TESTPOOL 33 34 # 35 # We are concurrently starting dd processes that will 36 # create files in $TESTDIR. These could cause the import 37 # to fail because it can't mount on the filesystem on a 38 # non-empty directory. Therefore, remove the directory 39 # so that the dd process will fail. 40 # 41 log_must rm -rf $TESTDIR 42 43 log_must zpool import $TESTPOOL 44 return 0 45} 46 47test_removal_with_operation callback 48 49log_pass "Can export and import pool during removal" 50