]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test_envlibrados_for_rocksdb: use helper script
authorKefu Chai <kchai@redhat.com>
Wed, 12 Jun 2019 04:32:58 +0000 (12:32 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 12 Jun 2019 09:46:46 +0000 (17:46 +0800)
instead of having its own copy of `install()`, try to leverage the
helper in ceph-helpers-root.sh.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/rados/test_envlibrados_for_rocksdb.sh

index 31bb775fec5c824e928f62d9ab8ca519e89ec1a2..07cc01f5e238982ee897ae34c29a94397d63d502 100755 (executable)
@@ -4,29 +4,8 @@ set -ex
 ############################################
 #                      Helper functions
 ############################################
-function install() {
-    for package in "$@" ; do
-        install_one $package
-    done
-    return 0
-}
+source $(dirname $0)/../ceph-helpers-root.sh
 
-function install_one() {
-    case $(lsb_release -si) in
-        Ubuntu|Debian|Devuan)
-            sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y "$@"
-            ;;
-        CentOS|Fedora|RedHatEnterpriseServer)
-            sudo yum install -y "$@"
-            ;;
-        *SUSE*)
-            sudo zypper --non-interactive install "$@"
-            ;;
-        *)
-            echo "$(lsb_release -si) is unknown, $@ will have to be installed manually."
-            ;;
-    esac
-}
 ############################################
 #                      Install required tools
 ############################################
@@ -40,15 +19,15 @@ CURRENT_PATH=`pwd`
 ############################################
 # install prerequisites
 # for rocksdb
-case $(lsb_release -si) in
-       Ubuntu|Debian|Devuan)
+case $(distro_id) in
+       ubuntu|debian|devuan)
                install g++ libsnappy-dev zlib1g-dev libbz2-dev libradospp-dev
                ;;
-       CentOS|Fedora|RedHatEnterpriseServer)
+       centos|fedora|rhel)
                install gcc-c++.x86_64 snappy-devel zlib zlib-devel bzip2 bzip2-devel libradospp-devel.x86_64
                ;;
        *)
-        echo "$(lsb_release -si) is unknown, $@ will have to be installed manually."
+        echo "$(distro_id) is unknown, $@ will have to be installed manually."
         ;;
 esac