Lines Matching +full:cmd +full:- +full:max +full:- +full:name
3 os=`uname -s`
6 if [ $? -eq 0 ]; then
13 if [ -z "${LUSTRE}" ]; then
17 zpool_f_flag="-f"
22 zpool_f_flag="-F"
26 # Use correct arguments to cmd line programs
27 stat --version 2>/dev/null | grep GNU >/dev/null
28 if [ $? -eq 0 ]; then
32 import_flags="-d /dev/lofi"
33 mount_t_flag="-F"
35 mount_t_flag="-t"
52 name="${1}"
55 dd if=/dev/urandom of=${name} bs=${size} count=1 >/dev/null 2>&1
62 …eexp=`echo "${eorig}" | egrep -v '^[ ]*$' | sed 's/^[ ][ ]*//g;s/[ ][ ]*$//g;s/[ ][ ]*/ /g;…
64 gorig=`sh -c "$*" 2>&1`
65 …got=`echo "${gorig}" | egrep -v '^[ ]*$' | sed 's/^[ ][ ]*//g;s/[ ][ ]*$//g;s/[ ][ ]*/ /g;s…
67 if [ $? -eq 0 ]; then
71 echo "# ----- expected from: $*"
73 echo "# ----- got:"
75 echo "# ----- end"
84 if [ $ec -eq 0 ]; then
86 echo "# ----- expected success from: $*"
87 if [ ! -z "${out}" ]; then
88 echo "# ----- output (exit code=${ec}):"
90 echo "# ----- end"
94 echo "# ----- expected success from: $*"
95 echo "# ----- output (exit code=${ec}):"
97 echo "# ----- end"
106 if [ $ec -ne 0 ]; then
108 echo "# ----- expected failure from: $*"
109 if [ ! -z "${out}" ]; then
110 echo "# ----- output (exit code=${ec}):"
112 echo "# ----- end"
116 echo "# ----- expected failure from: $*"
117 echo "# ----- output (exit code=${ec}):"
119 echo "# ----- end"
134 cmd="mktemp -d /tmp/zfs-regression.XXXXXXXXXX"
135 TMPDIR=`${cmd}` || die "failed: ${cmd}"
136 cmd="mount -t tmpfs none ${TMPDIR}"
137 ${cmd} || die "failed: ${cmd}"
143 if [ -n "${TMPDIR}" ]; then
144 cmd="umount ${TMPDIR} && rmdir ${TMPDIR}"
145 eval "${cmd}" || die "failed: ${cmd}"
155 cmd="dd if=/dev/null of=${file} bs=1 count=0 seek=${size}"
156 ${cmd} > /dev/null 2>&1 || die "failed: ${cmd}"
159 # Create a memory-backed block device
166 if [ -n "${devname}" ]; then
167 devparam="-u ${devname}"
169 cmd="mdconfig -a -t swap -s ${size} ${devparam}"
170 DISKNAME=`$cmd 2>/dev/null` || die "failed: ${cmd}"
171 if [ -n "${devname}" ]; then
176 cmd="mktemp /tmp/zfstest.XXXXXXXXXX"
177 fname=`${cmd}` || die "failed: ${cmd}"
181 if [ -n "${devname}" ]; then
182 cmd="lofiadm -a ${fname} ${devname}"
183 ${cmd} || die "failed: ${cmd}"
186 cmd="lofiadm -a ${fname}"
187 DISKNAME=`${cmd}` || die "failed: ${cmd}"
191 if [ -z "${TMPDIR_DISKS}" ]; then
196 cmd="mktemp ${TMPDIR_DISKS}/disk.XXXXXXXXXX"
197 fname=`${cmd}` || die "failed: ${cmd}"
201 if [ -n "${devname}" ]; then
202 devname=`echo ${devname} | cut -c 9-`
203 cmd="losetup /dev/${devname} ${fname} 2>&1"
204 eval ${cmd} || die "failed: ${cmd}"
207 cmd="losetup -s -f ${fname} 2>&1"
208 diskname=`eval ${cmd}`
212 … max=`echo /dev/loop* | awk 'BEGIN { RS=" "; FS="loop" } {if ($2 > max) max = $2} END {print max}'`
213 max=$((max + 1))
214 cmd="mknod /dev/loop${max} b 7 ${max}"
215 ${cmd} || die "failed: ${cmd}"
217 cmd="losetup -s -f ${fname}"
218 diskname=`${cmd}` || die "failed: ${cmd}"
230 # Destroy a memory-backed block device
236 cmd="mdconfig -d -u ${disk}"
237 ${cmd} || die "failed: ${cmd}"
239 cmd="lofiadm ${disk}"
240 fname=`${cmd}` || die "failed: ${cmd}"
242 cmd="lofiadm -d ${disk}"
243 ${cmd} || die "failed: ${cmd}"
245 cmd="rm ${fname}"
246 ${cmd} || die "failed: ${cmd}"
248 cmd="rm /dev/${disk}"
249 ${cmd} || die "failed: ${cmd}"
250 disk=`echo ${disk} | cut -c 9-`
252 cmd="losetup /dev/${disk} | awk '{print substr(\$3, 2, length(\$3)-2)}'"
253 fname=`eval ${cmd}` || die "failed: ${cmd}"
255 cmd="losetup -d /dev/${disk}"
256 ${cmd} || die "failed: ${cmd}"
258 cmd="rm ${fname}"
259 ${cmd} || die "failed: ${cmd}"
267 if [ -z "${ndisks}" ]; then
273 n=$((ndisks-$start))
274 if [ -z "${2}" ]; then
290 if [ ! -z "${disk}" ]; then
294 [ -n "${TMPDIR_DISKS}" ] && TMPDIR="${TMPDIR_DISKS}" cleanup_tmpfs
302 if [ ! -z ${disk} ]; then
306 if [ -z "${3}" ]; then
326 if [ -z "${nfiles}" ]; then
332 n=$((nfiles-$start))
333 if [ -z "${2}" ]; then
340 if [ -z "${TMPDIR_FILES}" ]; then
357 rm -f ${file}
360 [ -n "${TMPDIR_FILES}" ] && TMPDIR="${TMPDIR_FILES}" cleanup_tmpfs
373 eval name${i}=`name_create`
380 if [ ! -d "${dir}" ]; then
383 if [ -n "${GNU_STAT}" ]; then
384 statcmd="stat -c"
386 statcmd="stat -f"
388 if [ "`${statcmd} '%d' ${dir} 2>/dev/null`" -eq "`${statcmd} '%d' ${dir}/.. 2>/dev/null`" ]; then
397 if [ $? -eq 0 ]; then
403 [ -z "${start}" ] && start="1";
404 end=$((${1}+${start}-1))
407 if [ $? -eq 0 ]; then
415 if [ $i -eq ${1} ]; then
426 if [ $? -ne 0 ]; then
435 ${ZDB} -l ${1} | grep -B1 ${1} | grep guid | head -n1 | awk 'BEGIN {FS="="} {print $2}'