]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test that builds example librados programs 23131/head
authorNathan Cutler <ncutler@suse.com>
Thu, 19 Jul 2018 15:59:04 +0000 (17:59 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 25 Sep 2018 11:18:04 +0000 (13:18 +0200)
Fixes: http://tracker.ceph.com/issues/15100
Signed-off-by: Nathan Cutler <ncutler@suse.com>
qa/suites/rados/singleton-nomsgr/all/librados_hello_world.yaml [new file with mode: 0644]
qa/workunits/rados/test_librados_build.sh [new file with mode: 0755]

diff --git a/qa/suites/rados/singleton-nomsgr/all/librados_hello_world.yaml b/qa/suites/rados/singleton-nomsgr/all/librados_hello_world.yaml
new file mode 100644 (file)
index 0000000..f77f5bb
--- /dev/null
@@ -0,0 +1,20 @@
+roles:
+- [mon.a, mds.a, mgr.x, osd.0, osd.1, client.0]
+overrides:
+  ceph:
+    log-whitelist:
+      - \(POOL_APP_NOT_ENABLED\)
+tasks:
+- install:
+    extra_packages:
+      deb:
+        - libradosstriper-dev
+        - librados-dev
+      rpm:
+        - libradosstriper-devel
+        - librados-devel
+- ceph:
+- workunit:
+    clients:
+      all:
+        - rados/test_librados_build.sh
diff --git a/qa/workunits/rados/test_librados_build.sh b/qa/workunits/rados/test_librados_build.sh
new file mode 100755 (executable)
index 0000000..43ded25
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/bash -ex
+#
+# Compile and run a librados application outside of the ceph build system, so
+# that we can be sure librados.h[pp] is still usable and hasn't accidentally
+# started depending on internal headers.
+#
+# The script assumes all dependencies - e.g. curl, make, gcc, librados headers,
+# libradosstriper headers, boost headers, etc. - are already installed.
+#
+
+trap cleanup EXIT
+
+SOURCES="hello_radosstriper.cc
+hello_world_c.c
+hello_world.cc
+Makefile
+"
+BINARIES_TO_RUN="hello_world_c
+hello_world_cpp
+"
+BINARIES="${BINARIES_TO_RUN}hello_radosstriper_cpp
+"
+DL_PREFIX="http://git.ceph.com/?p=ceph.git;a=blob_plain;f=examples/librados/"
+#DL_PREFIX="https://raw.githubusercontent.com/ceph/ceph/master/examples/librados/"
+DESTDIR=$(pwd)
+
+function cleanup () {
+    for f in $BINARIES$SOURCES ; do
+        rm -f "${DESTDIR}/$f"
+    done
+}
+
+function get_sources () {
+    for s in $SOURCES ; do
+        curl --progress-bar --output $s ${DL_PREFIX}$s
+    done
+}
+
+function check_sources () {
+    for s in $SOURCES ; do
+        test -f $s
+    done
+}
+
+function check_binaries () {
+    for b in $BINARIES ; do
+        file $b
+        test -f $b
+    done
+}
+
+function run_binaries () {
+    for b in $BINARIES_TO_RUN ; do
+        ./$b -c /etc/ceph/ceph.conf
+    done
+}
+
+pushd $DESTDIR
+get_sources
+check_sources
+make all-system
+check_binaries
+run_binaries
+popd