2020-02-08 01:08:49 +00:00
|
|
|
#!/bin/bash -ex
|
2020-02-06 17:02:31 +00:00
|
|
|
|
|
|
|
SCRIPT_NAME=$(basename ${BASH_SOURCE[0]})
|
2020-02-08 01:08:49 +00:00
|
|
|
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
|
2020-02-06 17:02:31 +00:00
|
|
|
CEPHADM_SRC_DIR=${SCRIPT_DIR}/../../../src/cephadm
|
2021-11-19 19:56:37 +00:00
|
|
|
|
|
|
|
[ -d "$TMPDIR" ] || TMPDIR=$(mktemp -d tmp.$SCRIPT_NAME.XXXXXX)
|
|
|
|
trap "$SUDO rm -rf $TMPDIR" EXIT
|
|
|
|
|
|
|
|
if [ -z "$CEPHADM" ]; then
|
|
|
|
CEPHADM=`mktemp -p $TMPDIR tmp.cephadm.XXXXXX`
|
|
|
|
${CEPHADM_SRC_DIR}/build.sh "$CEPHADM"
|
|
|
|
fi
|
2020-02-06 17:02:31 +00:00
|
|
|
|
|
|
|
# this is a pretty weak test, unfortunately, since the
|
|
|
|
# package may also be in the base OS.
|
|
|
|
function test_install_uninstall() {
|
2020-02-08 04:16:29 +00:00
|
|
|
( sudo apt update && \
|
|
|
|
sudo apt -y install cephadm && \
|
2020-03-15 13:51:51 +00:00
|
|
|
sudo $CEPHADM install && \
|
2020-02-06 17:02:31 +00:00
|
|
|
sudo apt -y remove cephadm ) || \
|
|
|
|
( sudo yum -y install cephadm && \
|
2020-03-15 13:51:51 +00:00
|
|
|
sudo $CEPHADM install && \
|
2020-02-06 17:02:31 +00:00
|
|
|
sudo yum -y remove cephadm ) || \
|
|
|
|
( sudo dnf -y install cephadm && \
|
2020-03-15 13:51:51 +00:00
|
|
|
sudo $CEPHADM install && \
|
2021-11-19 20:03:15 +00:00
|
|
|
sudo dnf -y remove cephadm ) || \
|
|
|
|
( sudo zypper -n install cephadm && \
|
|
|
|
sudo $CEPHADM install && \
|
|
|
|
sudo zypper -n remove cephadm )
|
2020-02-06 17:02:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sudo $CEPHADM -v add-repo --release octopus
|
|
|
|
test_install_uninstall
|
|
|
|
sudo $CEPHADM -v rm-repo
|
|
|
|
|
2022-07-25 20:46:39 +00:00
|
|
|
sudo $CEPHADM -v add-repo --dev main
|
2020-02-06 17:02:31 +00:00
|
|
|
test_install_uninstall
|
|
|
|
sudo $CEPHADM -v rm-repo
|
|
|
|
|
2021-01-24 00:56:42 +00:00
|
|
|
sudo $CEPHADM -v add-repo --release 15.2.7
|
2020-03-18 16:40:33 +00:00
|
|
|
test_install_uninstall
|
|
|
|
sudo $CEPHADM -v rm-repo
|
|
|
|
|
2020-02-06 17:02:31 +00:00
|
|
|
echo OK.
|