]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephadm/test_repos: add test for the repo commands
authorSage Weil <sage@redhat.com>
Thu, 6 Feb 2020 17:02:31 +0000 (11:02 -0600)
committerSage Weil <sage@redhat.com>
Fri, 7 Feb 2020 17:14:47 +0000 (11:14 -0600)
This isn't a great test, but it is something.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/suites/rados/singleton-flat/cephadm/cephadm.yaml [deleted file]
qa/suites/rados/singleton-flat/cephadm/task/test_cephadm.yaml [new file with mode: 0644]
qa/suites/rados/singleton-flat/cephadm/task/test_cephadm_repos.yaml [new file with mode: 0644]
qa/workunits/cephadm/test_repos.sh [new file with mode: 0755]

diff --git a/qa/suites/rados/singleton-flat/cephadm/cephadm.yaml b/qa/suites/rados/singleton-flat/cephadm/cephadm.yaml
deleted file mode 100644 (file)
index 4d25351..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-roles:
-- [mon.a, mgr.x, osd.0, client.0]
-tasks:
-- install:
-- exec:
-    mon.a:
-      - yum install -y python3 || apt install -y python3
-- workunit:
-    clients:
-      client.0:
-        - cephadm/test_cephadm.sh
diff --git a/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm.yaml b/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm.yaml
new file mode 100644 (file)
index 0000000..4d25351
--- /dev/null
@@ -0,0 +1,11 @@
+roles:
+- [mon.a, mgr.x, osd.0, client.0]
+tasks:
+- install:
+- exec:
+    mon.a:
+      - yum install -y python3 || apt install -y python3
+- workunit:
+    clients:
+      client.0:
+        - cephadm/test_cephadm.sh
diff --git a/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm_repos.yaml b/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm_repos.yaml
new file mode 100644 (file)
index 0000000..94a496d
--- /dev/null
@@ -0,0 +1,7 @@
+roles:
+- [mon.a, mgr.x, osd.0, client.0]
+tasks:
+- workunit:
+    clients:
+      client.0:
+        - cephadm/test_repos.sh
diff --git a/qa/workunits/cephadm/test_repos.sh b/qa/workunits/cephadm/test_repos.sh
new file mode 100755 (executable)
index 0000000..2707df2
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh -ex
+
+SCRIPT_NAME=$(basename ${BASH_SOURCE[0]})
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+CEPHADM_SRC_DIR=${SCRIPT_DIR}/../../../src/cephadm
+CEPHADM=${CEPHADM_SRC_DIR}/cephadm
+
+# this is a pretty weak test, unfortunately, since the
+# package may also be in the base OS.
+function test_install_uninstall() {
+    ( sudo apt -y install cephadm && \
+         sudo apt -y remove cephadm ) || \
+       ( sudo yum -y install cephadm && \
+             sudo yum -y remove cephadm ) || \
+       ( sudo dnf -y install cephadm && \
+             sudo dnf -y remove cephadm )
+}
+
+sudo $CEPHADM -v add-repo --release octopus
+test_install_uninstall
+sudo $CEPHADM -v rm-repo
+
+sudo $CEPHADM -v add-repo --dev master
+test_install_uninstall
+sudo $CEPHADM -v rm-repo
+
+sudo $CEPHADM -v add-repo --dev $CEPH_REF
+test_install_uninstall
+sudo $CEPHADM -v rm-repo
+
+echo OK.