diff --git a/script/test/cri-integration.sh b/script/test/cri-integration.sh index 9bad27be7..5c50d207e 100755 --- a/script/test/cri-integration.sh +++ b/script/test/cri-integration.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit set -o nounset set -o pipefail -source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" +basedir="$(dirname "${BASH_SOURCE[0]}")" +source "${basedir}/utils.sh" + +ROOT="$( cd "${basedir}" && pwd )"/../.. cd "${ROOT}" # FOCUS focuses the test to run. diff --git a/script/test/utils.sh b/script/test/utils.sh index 6b84bbc02..f08cdfef0 100755 --- a/script/test/utils.sh +++ b/script/test/utils.sh @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/../.. - IS_WINDOWS=0 if [ -v "OS" ] && [ "${OS}" == "Windows_NT" ]; then IS_WINDOWS=1 diff --git a/test/build-test-images.sh b/test/build-test-images.sh index 8365027b3..4f810cf12 100755 --- a/test/build-test-images.sh +++ b/test/build-test-images.sh @@ -27,6 +27,8 @@ set -o pipefail basedir="$(dirname "${BASH_SOURCE[0]}")" source "${basedir}/build-utils.sh" source "${basedir}/init-buildx.sh" + +ROOT="$( cd "$basedir" && pwd )"/.. cd "${ROOT}" # ignore errors if the image already exists diff --git a/test/build-utils.sh b/test/build-utils.sh index 0bbc356c5..408e0b771 100755 --- a/test/build-utils.sh +++ b/test/build-utils.sh @@ -14,10 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. - # PROJECT is the gce project to upload tarball. -PROJECT=${PROJECT:-"k8s-cri-containerd"} +: "${PROJECT:=k8s-cri-containerd}" # GOOGLE_APPLICATION_CREDENTIALS is the path of service account file. if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then diff --git a/test/build.sh b/test/build.sh index 6ae4bce1f..8e782ecd3 100755 --- a/test/build.sh +++ b/test/build.sh @@ -22,7 +22,10 @@ set -o errexit set -o nounset set -o pipefail -source "$(dirname "${BASH_SOURCE[0]}")/build-utils.sh" +basedir="$(dirname "${BASH_SOURCE[0]}")" +source "${basedir}/build-utils.sh" + +ROOT="$( cd "${basedir}" && pwd )"/.. cd "${ROOT}" # Make sure output directory is clean.