]> git-server-git.apps.pok.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)
committerNathan Cutler <ncutler@suse.com>
Tue, 15 Oct 2019 20:01:46 +0000 (22:01 +0200)
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>
(cherry picked from commit 0072d487aabd1fdb1d4f3b6a59c802b6e8a13b9e)

Conflicts:
qa/workunits/rados/test_envlibrados_for_rocksdb.sh
- master has libradospp, luminous does not
- mimic+ does not install gflags-devel, but luminous (apparently) still needs it

qa/workunits/rados/test_envlibrados_for_rocksdb.sh

index 8cb42c700389359080fcc2557d2cfde87b5fe803..eede1b8e26c3bee2aea2d52f6bb22a9893ceca07 100755 (executable)
@@ -2,29 +2,8 @@
 ############################################
 #                      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 apt-get install -y --force-yes "$@"
-            ;;
-        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
 ############################################
@@ -38,15 +17,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++ libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev librados-dev
                ;;
-       CentOS|Fedora|RedHatEnterpriseServer)
+       centos|fedora|rhel)
                install gcc-c++.x86_64 gflags-devel snappy-devel zlib zlib-devel bzip2 bzip2-devel librados2-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