2020-04-01 15:06:17 +00:00
|
|
|
source $rootdir/scripts/common.sh
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function clear_nvme() {
|
2020-06-09 13:06:02 +00:00
|
|
|
mapfile -t bdf < <(get_first_nvme_bdf)
|
2020-04-01 15:06:17 +00:00
|
|
|
|
|
|
|
# Clear metadata on NVMe device
|
|
|
|
$rootdir/scripts/setup.sh reset
|
2020-04-14 12:27:34 +00:00
|
|
|
|
|
|
|
name=$(get_nvme_name_from_bdf "${bdf[0]}")
|
2020-04-01 15:06:17 +00:00
|
|
|
mountpoints=$(lsblk /dev/$name --output MOUNTPOINT -n | wc -w)
|
|
|
|
if [ "$mountpoints" != "0" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
dd if=/dev/zero of=/dev/$name bs=1M count=1000 oflag=direct
|
|
|
|
$rootdir/scripts/setup.sh
|
|
|
|
}
|