#!/bin/csh

echo "start burntest at `date`"

sysctl hw.twe0.try_twereset=0
sysctl hw.twe0.try_ecc_recover=0
sysctl hw.twe0.bio_permafail=0
sysctl hw.twe0.pthru_permafail=0

set DESTROY = ""
set PART = ""

## for destructive testing, set these two
set DESTROY = "-X"
set PART = "s1e"
## end

set SCRUB = "./diskscrub"

set DDIR = /var/crash/diskrun

mkdir ${DDIR}
mkdir ${DDIR}/pass1
mkdir ${DDIR}/pass2

## get both HEAD and 1.1 radish... one should work
(date ; isi_radish -a ; radish -qt) > ${DDIR}/radish_pre

@ TWEDN = 0
while ( $TWEDN < 20)
    if ( -e /dev/twed${TWEDN} ) then
	${SCRUB} -v -s ${DDIR}/pass1/log_twed${TWEDN} -s ${DDIR}/pass2/log_twed${TWEDN} ${DESTROY} /dev/twed${TWEDN}${PART} >> ${DDIR}/diskreport &
    endif

    @ TWEDN = ($TWEDN + 1)
end

  ${SCRUB} -v -s ${DDIR}/pass1/log_tweda -s ${DDIR}/pass2/log_tweda ${DESTROY} /dev/ad0${PART} >> ${DDIR}/diskreport  &

wait

## get both HEAD and 1.1 radish... one should work
(date ; isi_radish -a ; radish -qt) > ${DDIR}/radish_post

echo "end burntest at `date`"
