summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/build-rados31
-rwxr-xr-xdebian/tests/build-rbd24
-rwxr-xr-xdebian/tests/ceph-client11
-rw-r--r--debian/tests/control9
-rwxr-xr-xdebian/tests/python-ceph7
5 files changed, 82 insertions, 0 deletions
diff --git a/debian/tests/build-rados b/debian/tests/build-rados
new file mode 100755
index 00000000..c6299925
--- /dev/null
+++ b/debian/tests/build-rados
@@ -0,0 +1,31 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against librados2 to
+# validate that headers are installed and libraries exists
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > radostest.c
+#include <rados/librados.h>
+
+int
+main(void)
+{
+ int err;
+ rados_t cluster;
+
+ err = rados_create(&cluster, NULL);
+ if (err < 0) {
+ return (1);
+ }
+ return(0);
+}
+EOF
+
+gcc -o radostest radostest.c -lrados
+echo "build: OK"
+[ -x radostest ]
+./radostest
+echo "run: OK"
diff --git a/debian/tests/build-rbd b/debian/tests/build-rbd
new file mode 100755
index 00000000..5ad6f882
--- /dev/null
+++ b/debian/tests/build-rbd
@@ -0,0 +1,24 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against librbd1 to
+# validate that headers are installed and libraries exists
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > rbdtest.c
+#include <rbd/librbd.h>
+
+int
+main(void)
+{
+ return(0);
+}
+EOF
+
+gcc -o rbdtest rbdtest.c -lrbd
+echo "build: OK"
+[ -x rbdtest ]
+./rbdtest
+echo "run: OK"
diff --git a/debian/tests/ceph-client b/debian/tests/ceph-client
new file mode 100755
index 00000000..c693a569
--- /dev/null
+++ b/debian/tests/ceph-client
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+CLIENTS=('ceph')
+
+for client in "${CLIENTS[@]}"; do
+ echo -n "Testing client $client: "
+ $client -v 2>&1 > /dev/null
+ echo "OK"
+done
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 00000000..372a057d
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,9 @@
+Tests: ceph-client build-rados build-rbd python-ceph
+Depends:
+ build-essential,
+ ceph-common,
+ librados-dev,
+ librbd-dev,
+ python3-rados,
+ python3-rbd,
+Restrictions: needs-root
diff --git a/debian/tests/python-ceph b/debian/tests/python-ceph
new file mode 100755
index 00000000..006dbe63
--- /dev/null
+++ b/debian/tests/python-ceph
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+
+# Test that rbd and rados can be imported OK
+import rbd
+import rados
+
+print("python-ceph: OK")