diff --git a/ci/openshift-ci/cluster/deploy_webhook.sh b/ci/openshift-ci/cluster/deploy_webhook.sh index b18cc699de..40a8f55e36 100755 --- a/ci/openshift-ci/cluster/deploy_webhook.sh +++ b/ci/openshift-ci/cluster/deploy_webhook.sh @@ -14,8 +14,8 @@ set -o nounset set -o pipefail script_dir="$(dirname $0)" -webhook_dir="${script_dir}/../../../kata-webhook" -source "${script_dir}/../../lib.sh" +webhook_dir="${script_dir}/../../../tools/testing/kata-webhook" +source "${script_dir}/../lib.sh" KATA_RUNTIME=${KATA_RUNTIME:-kata-ci} info "Creates the kata-webhook ConfigMap" diff --git a/ci/openshift-ci/cluster/install_kata.sh b/ci/openshift-ci/cluster/install_kata.sh index 694655e930..82e80d6432 100755 --- a/ci/openshift-ci/cluster/install_kata.sh +++ b/ci/openshift-ci/cluster/install_kata.sh @@ -11,7 +11,7 @@ scripts_dir=$(dirname $0) deployments_dir=${scripts_dir}/deployments configs_dir=${scripts_dir}/configs -source ${scripts_dir}/../../lib.sh +source ${scripts_dir}/../lib.sh # Set to 'yes' if you want to configure SELinux to permissive on the cluster # workers. diff --git a/ci/openshift-ci/lib.sh b/ci/openshift-ci/lib.sh new file mode 100644 index 0000000000..618844074d --- /dev/null +++ b/ci/openshift-ci/lib.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2023 Red Hat +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Ensure GOPATH set +if command -v go > /dev/null; then + export GOPATH=${GOPATH:-$(go env GOPATH)} +else + # if go isn't installed, set default location for GOPATH + export GOPATH="${GOPATH:-$HOME/go}" +fi + +lib_dir=$(dirname "${BASH_SOURCE[0]}") +source "$lib_dir/../../tests/common.bash" + +export katacontainers_repo=${katacontainers_repo:="github.com/kata-containers/kata-containers"} +export katacontainers_repo_dir="${GOPATH}/src/${katacontainers_repo}" diff --git a/ci/openshift-ci/run_smoke_test.sh b/ci/openshift-ci/run_smoke_test.sh index df205eb0a6..6101ae7fa4 100755 --- a/ci/openshift-ci/run_smoke_test.sh +++ b/ci/openshift-ci/run_smoke_test.sh @@ -8,7 +8,7 @@ # script_dir=$(dirname $0) -source ${script_dir}/../lib.sh +source ${script_dir}/lib.sh pod='http-server' diff --git a/ci/openshift-ci/test.sh b/ci/openshift-ci/test.sh index 59cb5022a7..be661ecbd3 100755 --- a/ci/openshift-ci/test.sh +++ b/ci/openshift-ci/test.sh @@ -6,7 +6,7 @@ # script_dir=$(dirname $0) -source ${script_dir}/../lib.sh +source ${script_dir}/lib.sh suite=$1 if [ -z "$1" ]; then