]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rados/test_librados_build.sh
update sources to 12.2.10
[ceph.git] / ceph / qa / workunits / rados / test_librados_build.sh
CommitLineData
91327a77
AA
1#!/bin/bash -ex
2#
3# Compile and run a librados application outside of the ceph build system, so
4# that we can be sure librados.h[pp] is still usable and hasn't accidentally
5# started depending on internal headers.
6#
7# The script assumes all dependencies - e.g. curl, make, gcc, librados headers,
8# libradosstriper headers, boost headers, etc. - are already installed.
9#
10
11trap cleanup EXIT
12
13SOURCES="hello_radosstriper.cc
14hello_world_c.c
15hello_world.cc
16Makefile
17"
18BINARIES_TO_RUN="hello_world_c
19hello_world_cpp
20"
21BINARIES="${BINARIES_TO_RUN}hello_radosstriper_cpp
22"
23DL_PREFIX="http://git.ceph.com/?p=ceph.git;a=blob_plain;f=examples/librados/"
24#DL_PREFIX="https://raw.githubusercontent.com/ceph/ceph/master/examples/librados/"
25DESTDIR=$(pwd)
26
27function cleanup () {
28 for f in $BINARIES$SOURCES ; do
29 rm -f "${DESTDIR}/$f"
30 done
31}
32
33function get_sources () {
34 for s in $SOURCES ; do
35 curl --progress-bar --output $s ${DL_PREFIX}$s
36 done
37}
38
39function check_sources () {
40 for s in $SOURCES ; do
41 test -f $s
42 done
43}
44
45function check_binaries () {
46 for b in $BINARIES ; do
47 file $b
48 test -f $b
49 done
50}
51
52function run_binaries () {
53 for b in $BINARIES_TO_RUN ; do
54 ./$b -c /etc/ceph/ceph.conf
55 done
56}
57
58pushd $DESTDIR
59get_sources
60check_sources
61make all-system
62check_binaries
63run_binaries
64popd