]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rados/test_envlibrados_for_rocksdb.sh
update sources to 12.2.7
[ceph.git] / ceph / qa / workunits / rados / test_envlibrados_for_rocksdb.sh
CommitLineData
7c673cae
FG
1#!/bin/bash -ex
2############################################
3# Helper functions
4############################################
5function install() {
6 for package in "$@" ; do
7 install_one $package
8 done
9 return 0
10}
11
12function install_one() {
13 case $(lsb_release -si) in
14 Ubuntu|Debian|Devuan)
15 sudo apt-get install -y --force-yes "$@"
16 ;;
17 CentOS|Fedora|RedHatEnterpriseServer)
18 sudo yum install -y "$@"
19 ;;
20 *SUSE*)
21 sudo zypper --non-interactive install "$@"
22 ;;
23 *)
24 echo "$(lsb_release -si) is unknown, $@ will have to be installed manually."
25 ;;
26 esac
27}
28############################################
29# Install required tools
30############################################
31echo "Install required tools"
32install git automake
33
34CURRENT_PATH=`pwd`
35
36############################################
37# Compile&Start RocksDB
38############################################
39# install prerequisites
40# for rocksdb
41case $(lsb_release -si) in
42 Ubuntu|Debian|Devuan)
43 install g++-4.7 libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev librados-dev
44 ;;
45 CentOS|Fedora|RedHatEnterpriseServer)
46 install gcc-c++.x86_64 gflags-devel snappy-devel zlib zlib-devel bzip2 bzip2-devel librados2-devel.x86_64
47 ;;
48 *)
49 echo "$(lsb_release -si) is unknown, $@ will have to be installed manually."
50 ;;
51esac
52
53# # gflags
54# sudo yum install gflags-devel
55#
56# wget https://github.com/schuhschuh/gflags/archive/master.zip
57# unzip master.zip
58# cd gflags-master
59# mkdir build && cd build
60# export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
61# make && make install
62
63# # snappy-devel
64
65
66echo "Compile rocksdb"
67if [ -e rocksdb ]; then
68 rm -fr rocksdb
69fi
224ce89b 70git clone https://github.com/facebook/rocksdb.git --depth 1
7c673cae
FG
71
72# compile code
73cd rocksdb
28e407b8 74make env_librados_test ROCKSDB_USE_LIBRADOS=1 DISABLE_WARNING_AS_ERROR=1 -j8
7c673cae
FG
75
76echo "Copy ceph.conf"
77# prepare ceph.conf
78mkdir -p ../ceph/src/
79if [ -f "/etc/ceph/ceph.conf" ]; then
80 cp /etc/ceph/ceph.conf ../ceph/src/
81elif [ -f "/etc/ceph/ceph/ceph.conf" ]; then
82 cp /etc/ceph/ceph/ceph.conf ../ceph/src/
83else
84 echo "/etc/ceph/ceph/ceph.conf doesn't exist"
85fi
86
87echo "Run EnvLibrados test"
88# run test
89if [ -f "../ceph/src/ceph.conf" ]
90 then
91 cp env_librados_test ~/cephtest/archive
92 ./env_librados_test
93else
94 echo "../ceph/src/ceph.conf doesn't exist"
95fi
96cd ${CURRENT_PATH}