1*5cabbc6bSPrashanth Sreenivasa#! /bin/ksh -p 2*5cabbc6bSPrashanth Sreenivasa# 3*5cabbc6bSPrashanth Sreenivasa# CDDL HEADER START 4*5cabbc6bSPrashanth Sreenivasa# 5*5cabbc6bSPrashanth Sreenivasa# This file and its contents are supplied under the terms of the 6*5cabbc6bSPrashanth Sreenivasa# Common Development and Distribution License ("CDDL"), version 1.0. 7*5cabbc6bSPrashanth Sreenivasa# You may only use this file in accordance with the terms of version 8*5cabbc6bSPrashanth Sreenivasa# 1.0 of the CDDL. 9*5cabbc6bSPrashanth Sreenivasa# 10*5cabbc6bSPrashanth Sreenivasa# A full copy of the text of the CDDL should have accompanied this 11*5cabbc6bSPrashanth Sreenivasa# source. A copy of the CDDL is also available via the Internet at 12*5cabbc6bSPrashanth Sreenivasa# http://www.illumos.org/license/CDDL. 13*5cabbc6bSPrashanth Sreenivasa# 14*5cabbc6bSPrashanth Sreenivasa# CDDL HEADER END 15*5cabbc6bSPrashanth Sreenivasa# 16*5cabbc6bSPrashanth Sreenivasa 17*5cabbc6bSPrashanth Sreenivasa# 18*5cabbc6bSPrashanth Sreenivasa# Copyright (c) 2014, 2016 by Delphix. All rights reserved. 19*5cabbc6bSPrashanth Sreenivasa# 20*5cabbc6bSPrashanth Sreenivasa 21*5cabbc6bSPrashanth Sreenivasa. $STF_SUITE/include/libtest.shlib 22*5cabbc6bSPrashanth Sreenivasa. $STF_SUITE/tests/functional/removal/removal.kshlib 23*5cabbc6bSPrashanth Sreenivasa 24*5cabbc6bSPrashanth Sreenivasadefault_setup_noexit "$DISKS" 25*5cabbc6bSPrashanth Sreenivasalog_onexit default_cleanup_noexit 26*5cabbc6bSPrashanth Sreenivasa 27*5cabbc6bSPrashanth Sreenivasafor disk in $DISKS; do 28*5cabbc6bSPrashanth Sreenivasa if [[ "$disk" != "$REMOVEDISK" ]]; then 29*5cabbc6bSPrashanth Sreenivasa log_must zpool remove $TESTPOOL $disk 30*5cabbc6bSPrashanth Sreenivasa log_must wait_for_removal $TESTPOOL 31*5cabbc6bSPrashanth Sreenivasa log_mustnot vdevs_in_pool $TESTPOOL $disk 32*5cabbc6bSPrashanth Sreenivasa fi 33*5cabbc6bSPrashanth Sreenivasadone 34*5cabbc6bSPrashanth Sreenivasa 35*5cabbc6bSPrashanth Sreenivasalog_must [ "x$(get_disklist $TESTPOOL)" = "x$REMOVEDISK" ] 36*5cabbc6bSPrashanth Sreenivasa 37*5cabbc6bSPrashanth Sreenivasalog_mustnot zpool remove $TESTPOOL $disk 38*5cabbc6bSPrashanth Sreenivasa 39*5cabbc6bSPrashanth Sreenivasalog_pass "Was not able to remove the last device in a pool." 40