nvmf: Delete partitions when tests end
Change-Id: Ia30e037e98df8b0c781ce769453bbf891091334d Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
201843a9eb
commit
e660e677b8
@ -112,3 +112,18 @@ function killprocess() {
|
|||||||
kill $1
|
kill $1
|
||||||
wait $1 || true
|
wait $1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nvme_cleanup()
|
||||||
|
{
|
||||||
|
# Load the kernel driver
|
||||||
|
./scripts/setup.sh reset
|
||||||
|
|
||||||
|
# Let the kernel discover any filesystems or partitions
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
# Delete all partitions on NVMe devices
|
||||||
|
devs=`lsblk -l -o NAME | grep nvme`
|
||||||
|
for dev in $devs; do
|
||||||
|
parted -s /dev/$dev mklabel msdos
|
||||||
|
done
|
||||||
|
}
|
||||||
|
@ -18,7 +18,7 @@ timing_enter fs_test
|
|||||||
$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
|
$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
|
||||||
nvmfpid=$!
|
nvmfpid=$!
|
||||||
|
|
||||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
trap "killprocess $nvmfpid; nvme_cleanup; exit 1" SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
@ -58,6 +58,8 @@ for dev in $devs; do
|
|||||||
umount /mnt/device
|
umount /mnt/device
|
||||||
timing_exit $fstype
|
timing_exit $fstype
|
||||||
done
|
done
|
||||||
|
|
||||||
|
parted -s /dev/$dev rm 1
|
||||||
done
|
done
|
||||||
|
|
||||||
sync
|
sync
|
||||||
|
Loading…
Reference in New Issue
Block a user