From a98855ecf5f41d5c5c713cd709318a1fe91ee214 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 6 Feb 2020 11:02:31 -0600 Subject: [PATCH] qa/workunits/cephadm/test_repos: add test for the repo commands This isn't a great test, but it is something. Signed-off-by: Sage Weil --- .../{cephadm.yaml => task/test_cephadm.yaml} | 0 .../cephadm/task/test_cephadm_repos.yaml | 7 +++++ qa/workunits/cephadm/test_repos.sh | 31 +++++++++++++++++++ 3 files changed, 38 insertions(+) rename qa/suites/rados/singleton-flat/cephadm/{cephadm.yaml => task/test_cephadm.yaml} (100%) create mode 100644 qa/suites/rados/singleton-flat/cephadm/task/test_cephadm_repos.yaml create mode 100755 qa/workunits/cephadm/test_repos.sh diff --git a/qa/suites/rados/singleton-flat/cephadm/cephadm.yaml b/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm.yaml similarity index 100% rename from qa/suites/rados/singleton-flat/cephadm/cephadm.yaml rename to qa/suites/rados/singleton-flat/cephadm/task/test_cephadm.yaml 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 index 00000000000..94a496d66cd --- /dev/null +++ b/qa/suites/rados/singleton-flat/cephadm/task/test_cephadm_repos.yaml @@ -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 index 00000000000..2707df212a5 --- /dev/null +++ b/qa/workunits/cephadm/test_repos.sh @@ -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. -- 2.39.5