From 188c32323bfb729f7ba064c77e839291eacfe3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Sun, 22 Feb 2015 02:31:28 +0100 Subject: [PATCH] WIP: first implementation of functional tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- tests/README.md | 6 ++++++ tests/validate-ceph.yml | 13 +++++++++++++ tests/validate-mds.yml | 14 ++++++++++++++ tests/validate-mon.yml | 14 ++++++++++++++ tests/validate-rados.yml | 32 ++++++++++++++++++++++++++++++++ tests/validate-rbd.yml | 13 +++++++++++++ tests/validate-rgw.yml | 14 ++++++++++++++ 7 files changed, 106 insertions(+) create mode 100644 tests/README.md create mode 100644 tests/validate-ceph.yml create mode 100644 tests/validate-mds.yml create mode 100644 tests/validate-mon.yml create mode 100644 tests/validate-rados.yml create mode 100644 tests/validate-rbd.yml create mode 100644 tests/validate-rgw.yml diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 000000000..a660d6580 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,6 @@ +Functional tests +================ + +These playbooks aim to individually validate each Ceph component. +Some of them require packages to be installed. +Ideally you will run these tests from a client machine or from the Ansible server. diff --git a/tests/validate-ceph.yml b/tests/validate-ceph.yml new file mode 100644 index 000000000..3ef739499 --- /dev/null +++ b/tests/validate-ceph.yml @@ -0,0 +1,13 @@ +# This playbook tests a Ceph + +- hosts: + - osds + + vars: + foo: bar + + tasks: + + - name: foo + command: bar + delegate_to: foobar diff --git a/tests/validate-mds.yml b/tests/validate-mds.yml new file mode 100644 index 000000000..c397869d5 --- /dev/null +++ b/tests/validate-mds.yml @@ -0,0 +1,14 @@ +--- +# This playbook tests a Ceph Metadata server + +- hosts: + - mdds + + vars: + foo: bar + + tasks: + + - name: foo + command: bar + delegate_to: foobar diff --git a/tests/validate-mon.yml b/tests/validate-mon.yml new file mode 100644 index 000000000..b66732715 --- /dev/null +++ b/tests/validate-mon.yml @@ -0,0 +1,14 @@ +--- +# This playbook tests a Ceph monitor + +- hosts: + - mons + + vars: + foo: bar + + tasks: + + - name: foo + command: bar + delegate_to: foobar diff --git a/tests/validate-rados.yml b/tests/validate-rados.yml new file mode 100644 index 000000000..f0dfc2e6a --- /dev/null +++ b/tests/validate-rados.yml @@ -0,0 +1,32 @@ +--- +# This playbook tests a Ceph object storage daemon + +- hosts: + - 127.0.0.1 + roles: ceph-common + sudo: True + + vars: + foo: bar + + tasks: + + - name: Fetch ceph.conf and admin keyring + fetch: > + src=/etc/ceph/ceph.client.admin.keyring + dest=/etc/ceph/ceph.client.admin.keyring + fail_on_missing=yes + + - name: Create working directory + command: mktemp + register: tmp_work_dir + + - name: Create a file + command: dd if=/dev/zero of={{ tmp_work_dir.stdout }}/foobar count=1 bs=1M + + - name: Create an object + command: rados -p rbd put foobar.object {{ tmp_work_dir.stdout }}/foobar + delegate_to: foobar + + - name: Get an object + command: rados -p rbd get foobar.object {{ tmp_work_dir.stdout }}/foobar.file diff --git a/tests/validate-rbd.yml b/tests/validate-rbd.yml new file mode 100644 index 000000000..67eddc8bc --- /dev/null +++ b/tests/validate-rbd.yml @@ -0,0 +1,13 @@ +--- +# This playbook tests a Ceph object storage daemon + +- hosts: + - osds + + vars: + foo: bar + + tasks: + + - name: Create a RBD image + command: rbd create -s 10240 foobar diff --git a/tests/validate-rgw.yml b/tests/validate-rgw.yml new file mode 100644 index 000000000..a241232df --- /dev/null +++ b/tests/validate-rgw.yml @@ -0,0 +1,14 @@ +--- +# This playbook tests a Ceph monitor + +- hosts: + - rgws + + vars: + foo: bar + + tasks: + + - name: foo + command: bar + delegate_to: foobar