]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rados/test_envlibrados_for_rocksdb.sh
import ceph 14.2.5
[ceph.git] / ceph / qa / workunits / rados / test_envlibrados_for_rocksdb.sh
1 #!/usr/bin/env bash
2 set -ex
3
4 ############################################
5 # Helper functions
6 ############################################
7 source $(dirname $0)/../ceph-helpers-root.sh
8
9 ############################################
10 # Install required tools
11 ############################################
12 echo "Install required tools"
13
14 CURRENT_PATH=`pwd`
15
16 ############################################
17 # Compile&Start RocksDB
18 ############################################
19 # install prerequisites
20 # for rocksdb
21 case $(distro_id) in
22 ubuntu|debian|devuan)
23 install git g++ libsnappy-dev zlib1g-dev libbz2-dev libradospp-dev
24 case $(distro_version) in
25 *Xenial*)
26 install_cmake3_on_xenial
27 ;;
28 *)
29 install cmake
30 ;;
31 esac
32 ;;
33 centos|fedora|rhel)
34 install git gcc-c++.x86_64 snappy-devel zlib zlib-devel bzip2 bzip2-devel libradospp-devel.x86_64
35 if [ $(distro_id) = "fedora" ]; then
36 install cmake
37 else
38 install_cmake3_on_centos7
39 fi
40 ;;
41 opensuse*|suse|sles)
42 install git gcc-c++ snappy-devel zlib-devel libbz2-devel libradospp-devel
43 ;;
44 *)
45 echo "$(distro_id) is unknown, $@ will have to be installed manually."
46 ;;
47 esac
48
49 # # gflags
50 # sudo yum install gflags-devel
51 #
52 # wget https://github.com/schuhschuh/gflags/archive/master.zip
53 # unzip master.zip
54 # cd gflags-master
55 # mkdir build && cd build
56 # export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
57 # make && make install
58
59 # # snappy-devel
60
61
62 echo "Compile rocksdb"
63 if [ -e rocksdb ]; then
64 rm -fr rocksdb
65 fi
66 git clone https://github.com/facebook/rocksdb.git --depth 1
67
68 # compile code
69 cd rocksdb
70 if type cmake3 > /dev/null 2>&1 ; then
71 CMAKE=cmake3
72 else
73 CMAKE=cmake
74 fi
75 mkdir build && cd build && ${CMAKE} -DWITH_LIBRADOS=ON -DWITH_SNAPPY=ON -DWITH_GFLAGS=OFF -DFAIL_ON_WARNINGS=OFF ..
76 make rocksdb_env_librados_test -j8
77
78 echo "Copy ceph.conf"
79 # prepare ceph.conf
80 mkdir -p ../ceph/src/
81 if [ -f "/etc/ceph/ceph.conf" ]; then
82 cp /etc/ceph/ceph.conf ../ceph/src/
83 elif [ -f "/etc/ceph/ceph/ceph.conf" ]; then
84 cp /etc/ceph/ceph/ceph.conf ../ceph/src/
85 else
86 echo "/etc/ceph/ceph/ceph.conf doesn't exist"
87 fi
88
89 echo "Run EnvLibrados test"
90 # run test
91 if [ -f "../ceph/src/ceph.conf" ]
92 then
93 cp env_librados_test ~/cephtest/archive
94 ./env_librados_test
95 else
96 echo "../ceph/src/ceph.conf doesn't exist"
97 fi
98 cd ${CURRENT_PATH}