test/bdev: do not hardcode sgdisk directory

At least on Ubuntu, sgdisk gets installed to /sbin, not /usr/sbin.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I59c806d2c93c6a1773aea11d6fc669e3df0e3c08

Reviewed-on: https://review.gerrithub.io/369304
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Jim Harris 2017-07-12 15:12:24 -07:00
parent 15337ade6b
commit 86af2ae59f

View File

@ -17,7 +17,7 @@ timing_enter bounds
$testdir/bdevio/bdevio $testdir/bdev.conf
timing_exit bounds
if [ $(uname -s) = Linux ] && [ -f /usr/sbin/sgdisk ]; then
if [ $(uname -s) = Linux ] && hash sgdisk; then
echo "[Rpc]" >> $testdir/bdev.conf
echo " Enable Yes" >> $testdir/bdev.conf
@ -33,8 +33,8 @@ if [ $(uname -s) = Linux ] && [ -f /usr/sbin/sgdisk ]; then
if [ -e /dev/nbd0 ]; then
parted -s /dev/nbd0 mklabel gpt mkpart first '0%' '50%' mkpart second '50%' '100%'
# change the partition type GUID to SPDK GUID value
/usr/sbin/sgdisk -t 1:$SPDK_GPT_GUID /dev/nbd0
/usr/sbin/sgdisk -t 2:$SPDK_GPT_GUID /dev/nbd0
sgdisk -t 1:$SPDK_GPT_GUID /dev/nbd0
sgdisk -t 2:$SPDK_GPT_GUID /dev/nbd0
fi
killprocess $nbd_pid