Index: projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile (revision 292666) +++ projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile (revision 292667) @@ -1,60 +1,60 @@ # $FreeBSD$ .include MAN= BINDIR= ${TESTSBASE}/sys/cddl/zfs/bin SCRIPTSDIR= ${TESTSBASE}/sys/cddl/zfs/bin SCRIPTS+= bsddisks.ksh SCRIPTS+= df.ksh SCRIPTS+= dircmp.ksh SCRIPTS+= dumpadm.ksh SCRIPTS+= ff.ksh SCRIPTS+= fmadm.ksh SCRIPTS+= fmdump.ksh SCRIPTS+= format.ksh SCRIPTS+= groupadd.ksh SCRIPTS+= groupdel.ksh SCRIPTS+= groupmod.ksh SCRIPTS+= groupshow.ksh SCRIPTS+= svcs.ksh SCRIPTS+= swap.ksh SCRIPTS+= testenv.ksh SCRIPTS+= useradd.ksh SCRIPTS+= userdel.ksh SCRIPTS+= usermod.ksh SCRIPTS+= zfs.ksh SCRIPTS+= zfs_crypto.ksh SCRIPTS+= zfs_version.ksh SCRIPTS+= zlogin.ksh SCRIPTS+= zoneadm.ksh SCRIPTS+= zonecfg.ksh SCRIPTS+= zpool.ksh SCRIPTS+= zpool_bsd.ksh SCRIPTS+= zpool_smi.ksh SCRIPTS+= zpool_version.ksh PROGS+= chg_usr_exec # Not ported to FreeBSD # PROGRS+= devname2devid PROGS+= dir_rd_update PROGS+= file_check PROGS+= file_trunc PROGS+= file_write PROGS+= largest_file PROGS+= mktree PROGS+= mmapwrite PROGS+= randfree_file PROGS+= readmmap PROGS+= rename_dir PROGS+= rm_lnkcnt_zero_file .for p in ${PROGS} SRCS.$p= $p.c .endfor -LDADD.mmapwrite+= -lpthread -LDADD.rm_lnkcnt_zero_file+= -lpthread +LIBADD.mmapwrite+= pthread +LIBADD.rm_lnkcnt_zero_file+= pthread .include Index: projects/zfsd/head/tests/sys/cddl/zfs/include/testenv.kshlib =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/testenv.kshlib (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/testenv.kshlib (revision 292667) @@ -0,0 +1,19 @@ +. ${STF_SUITE}/include/libtest.kshlib +. ${STF_SUITE}/include/commands.cfg + +# Environment-dependent constants. +for d in `geom disk list | awk '/Name:/ {print $3}'`; do + # Clear the GPT label first to avoid spurious create failures. + gpart destroy -F $d >/dev/null 2>&1 + if gpart create -s gpt $d >/dev/null 2>&1 ; then + gpart destroy $d >/dev/null 2>&1 || continue + DISKS=("${DISKS[@]}" "/dev/$d") #"$DISKS $d" + fi + # Don't bother testing any more if we have enough already. + # Currently we use at most 5 disks plus 1 for temporary disks. + [ ${#DISKS[@]} -eq 6 ] && break +done +export KEEP="$(zpool list -H -o name)" + +# Pull in constants. +. ${STF_SUITE}/include/constants.cfg Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.kshlib =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.kshlib (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.kshlib (revision 292667) @@ -0,0 +1,32 @@ +# Common routines used by zpool_import*. + +function setup_missing_test_pool # +{ + typeset tvd_type=$1 + + setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1 \ + "" $tvd_type + log_must $CP $MYTESTFILE $TESTDIR1/$TESTFILE0 + log_must $ZPOOL export $TESTPOOL1 +} + +function recreate_missing_files +{ + destroy_pool $TESTPOOL1 + log_must $RM -rf $DEVICE_DIR/* + for (( devnum=0 ; $devnum < $MAX_NUM ; devnum += 1 )); do + log_must create_vdevs ${DEVICE_DIR}/${DEVICE_FILE}$devnum + done +} + +function cleanup_missing +{ + log_note "State of pools at the end of the test:" + poolexists $TESTPOOL1 && log_must $ZPOOL status $TESTPOOL1 + log_note "State of $DEVICE_DIR at the end of the test:" + log_cmd $ZPOOL import -d $DEVICE_DIR + destroy_pool $TESTPOOL1 + log_must $RM -rf $DEVICE_DIR/* + [[ -d $ALTER_ROOT ]] && log_must $RM -rf $ALTER_ROOT + [[ -d $BACKUP_DEVICE_DIR ]] && log_must $RM -rf $BACKUP_DEVICE_DIR +} Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/setup_basic.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/setup_basic.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/setup_basic.ksh (revision 292667) @@ -0,0 +1,30 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# Copyright 2015 Spectra Logic Corporation. All rights reserved. +# Use is subject to license terms. + +. $STF_SUITE/include/libtest.kshlib + +# Allow unprivileged user to touch log files in our temp dir +chmod 1777 ${TMPDIR} +chmod 666 ${TMPDIR}/* || true Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/threadsappend/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/threadsappend/Makefile (revision 292666) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/threadsappend/Makefile (revision 292667) @@ -1,19 +1,19 @@ # $FreeBSD$ .include TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/threadsappend FILESDIR=${TESTSDIR} BINDIR=${TESTSDIR} ATF_TESTS_KSH93+= threadsappend_test FILES+= cleanup.ksh FILES+= threadsappend_001_pos.ksh FILES+= threadsappend.cfg FILES+= setup.ksh PROG+= threadsappend -LDADD+= -lpthread +LIBADD+= pthread MAN= .include Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/txg_integrity/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/txg_integrity/Makefile (revision 292666) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/txg_integrity/Makefile (revision 292667) @@ -1,23 +1,23 @@ # $FreeBSD$ .include TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/txg_integrity FILESDIR=${TESTSDIR} BINDIR=${TESTSDIR} ATF_TESTS_KSH93+= txg_integrity_test FILES+= setup.ksh FILES+= txg_integrity_001_pos.ksh FILES+= fsync_integrity_001_pos.ksh FILES+= cleanup.ksh FILES+= txg_integrity.cfg PROGS+= txg_integrity PROGS+= fsync_integrity -LDADD+= -lpthread +LIBADD+= pthread SRCS.fsync_integrity= fsync_integrity.c SRCS.txg_integrity= txg_integrity.c .include