From 91f2ae8d11e1cc0436f942c430b02ff1d326b197 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 16 Feb 2024 22:59:09 +0100 Subject: [PATCH] tests: run vagrant_up.sh from dirname Signed-off-by: Guillaume Abrioux --- tests/scripts/vagrant_up.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/scripts/vagrant_up.sh b/tests/scripts/vagrant_up.sh index 6e101dee80..373bb8ce92 100644 --- a/tests/scripts/vagrant_up.sh +++ b/tests/scripts/vagrant_up.sh @@ -1,4 +1,22 @@ #!/bin/bash +set -x +echo "BEFORE: $@" +if [[ -n $1 ]]; then + DIRECTORY=$1 + shift +else + DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +fi +pushd "${DIRECTORY}" + +echo "AFTER: $@" + +if [[ -n $1 ]]; then + DIRECTORY=$1 +else + DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +fi +pushd "${DIRECTORY}" if [[ "${CEPH_ANSIBLE_VAGRANT_BOX}" =~ "centos/stream" ]]; then EL_VERSION="${CEPH_ANSIBLE_VAGRANT_BOX: -1}" @@ -17,3 +35,4 @@ do done sleep 10 +popd