From ed3c4394c2432091d80fb529643c08e06289315c Mon Sep 17 00:00:00 2001 From: Lei Yang Date: Mon, 23 Oct 2017 21:31:21 +0800 Subject: fio-test: use pre-installed binary if already installed Change-Id: Idac895e3c60da06befefa21457a30f9146d4b118 Signed-off-by: Lei Yang --- automated/linux/fio-test/fio-test.sh | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'automated') diff --git a/automated/linux/fio-test/fio-test.sh b/automated/linux/fio-test/fio-test.sh index fa91af2..cdbc23f 100755 --- a/automated/linux/fio-test/fio-test.sh +++ b/automated/linux/fio-test/fio-test.sh @@ -37,24 +37,28 @@ fio_build_install() { } install() { - dist_name - # shellcheck disable=SC2154 - case "${dist}" in - debian|ubuntu) - pkgs="fio" - install_deps "${pkgs}" "${SKIP_INSTALL}" - ;; - fedora|centos) - pkgs="libaio-devel gcc tar wget" - install_deps "${pkgs}" "${SKIP_INSTALL}" - fio_build_install - ;; - # When build do not have package manager - # Assume development tools pre-installed - *) - fio_build_install - ;; - esac + if which fio; then + info_msg "fio has been already installed" + else + dist_name + # shellcheck disable=SC2154 + case "${dist}" in + debian|ubuntu) + pkgs="fio" + install_deps "${pkgs}" "${SKIP_INSTALL}" + ;; + fedora|centos) + pkgs="libaio-devel gcc tar wget" + install_deps "${pkgs}" "${SKIP_INSTALL}" + fio_build_install + ;; + # When build do not have package manager + # Assume development tools pre-installed + *) + fio_build_install + ;; + esac + fi } fio_test() { -- cgit v1.2.3