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