1# 2# CDDL HEADER START 3# 4# This file and its contents are supplied under the terms of the 5# Common Development and Distribution License ("CDDL"), version 1.0. 6# You may only use this file in accordance with the terms of version 7# 1.0 of the CDDL. 8# 9# A full copy of the text of the CDDL should have accompanied this 10# source. A copy of the CDDL is also available via the Internet at 11# http://www.illumos.org/license/CDDL. 12# 13# CDDL HEADER END 14# 15 16# 17# Copyright (c) 2016 by Delphix. All rights reserved. 18# 19 20function initialize_prog_line # pool disk 21{ 22 typeset pool="$1" 23 typeset disk="$2" 24 zpool status "$pool" | grep "$disk" | grep "initialized" 25} 26 27function initialize_progress # pool disk 28{ 29 initialize_prog_line "$1" "$2" | \ 30 sed 's/.*(\([0-9]\{1,\}\)% initialized.*/\1/g' 31} 32 33function cleanup 34{ 35 if poolexists $TESTPOOL; then 36 log_must zpool destroy -f $TESTPOOL 37 fi 38 39 if poolexists $TESTPOOL1; then 40 log_must zpool destroy -f $TESTPOOL1 41 fi 42} 43log_onexit cleanup 44