Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix s3test runner script #353

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions tools/tests/s3tests-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ JOB=
TMPFILE=
TMPDIR=

CONTAINER_CMD=
_configure() {
if command -v podman ; then
CONTAINER_CMD=podman
elif command -v docker ; then
CONTAINER_CMD=docker
else
exit 2
fi
}


_setup() {
local test="$1"
Expand All @@ -26,10 +37,10 @@ _setup() {

if [ ! -d "${CEPH_DIR}/build/bin" ] ; then
echo "Using s3gw container"
CONTAINER=$(podman run --rm -d -p 7480:7480 quay.io/s3gw/s3gw:latest)
CONTAINER=$("$CONTAINER_CMD" run --rm -d -p 7480:7480 quay.io/s3gw/s3gw:latest)
elif ! grep -q -i suse /etc/os-release || [ "${FORCE_CONTAINER}" = "ON" ] ; then
echo "Using runtime container"
CONTAINER=$(podman run \
CONTAINER=$("$CONTAINER_CMD" run \
--rm \
-d \
-p 7480:7480 \
Expand Down Expand Up @@ -97,7 +108,7 @@ _run() {

_teardown() {
if [ -n "$CONTAINER" ] ; then
podman kill "$CONTAINER"
"$CONTAINER_CMD" kill "$CONTAINER"
else
kill "$JOB"
rm -rf "${TMPDIR}"
Expand All @@ -114,6 +125,7 @@ _convert() {


_main() {
_configure
[ -d "${OUTPUT_DIR}" ] || mkdir -p "${OUTPUT_DIR}"
[ -d "${OUTPUT_DIR}/logs" ] || mkdir -p "${OUTPUT_DIR}/logs"

Expand Down