From d5d199cfa71e7e18ac01bbfb00643a8ebb48ceb6 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Wed, 22 Aug 2018 15:47:55 +0800 Subject: [PATCH] test/fio: update the path of fio binary Get the path of fio binary dynamically. Change-Id: Ieb29bdfec33716828339a60e67dfe786e8ad278a Signed-off-by: Chen Wang Reviewed-on: https://review.gerrithub.io/423057 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- scripts/fio.py | 7 ++++++- test/nvmf/fio/nvmf_fio.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/fio.py b/scripts/fio.py index 8e2316d2b..ff84ec18c 100755 --- a/scripts/fio.py +++ b/scripts/fio.py @@ -65,7 +65,12 @@ def main(): print("Found devices: ", devices) configure_devices(devices) - fio_executable = '/usr/bin/fio' + try: + fio_executable = check_output("which --skip-alias fio", shell=True).split()[0] + except subprocess.CalledProcessError as e: + print(e) + print("Can't find the fio binary, please install it.") + sys.exit(1) device_paths = ['/dev/' + dev for dev in devices] sys.stdout.flush() diff --git a/test/nvmf/fio/nvmf_fio.py b/test/nvmf/fio/nvmf_fio.py index 2484c1897..3cead1fb7 100755 --- a/test/nvmf/fio/nvmf_fio.py +++ b/test/nvmf/fio/nvmf_fio.py @@ -65,7 +65,12 @@ def main(): print "Found devices: ", devices # configure_devices(devices) - fio_executable = '/usr/bin/fio' + try: + fio_executable = check_output("which --skip-alias fio", shell=True).split()[0] + except subprocess.CalledProcessError as e: + print(e) + print("Can't find the fio binary, please install it.") + sys.exit(1) device_paths = ['/dev/' + dev for dev in devices] print device_paths