From 05b2e4f6061be22da8d4d98ad166ba9a304c18e8 Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Thu, 1 Feb 2024 21:00:15 +0000 Subject: [PATCH] tests: k8s: install genpolicy Install the genpolicy app before starting test execution. Signed-off-by: Dan Mihai --- tests/common.bash | 19 +++++++++++++++---- tests/integration/kubernetes/gha-run.sh | 8 ++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/common.bash b/tests/common.bash index fe95dcbbc4..175ee8efc4 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -371,11 +371,10 @@ log_level = "debug" EOF } -function install_kata() { - local kata_tarball="kata-static.tar.xz" - declare -r katadir="/opt/kata" +function install_kata_common() { + declare -r katadir="$1" declare -r destdir="/" - declare -r local_bin_dir="/usr/local/bin/" + declare -r kata_tarball="kata-static.tar.xz" # Removing previous kata installation sudo rm -rf "${katadir}" @@ -383,6 +382,18 @@ function install_kata() { pushd "${kata_tarball_dir}" sudo tar -xvf "${kata_tarball}" -C "${destdir}" popd +} + +function install_kata_tools() { + declare -r katadir="/opt/kata" + install_kata_common "${katadir}" +} + +function install_kata() { + declare -r katadir="/opt/kata" + declare -r local_bin_dir="/usr/local/bin/" + + install_kata_common "${katadir}" # create symbolic links to kata components for b in "${katadir}"/bin/* ; do diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index b5a98778cd..11ab90d5ee 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -15,6 +15,7 @@ kubernetes_dir="$(dirname "$(readlink -f "$0")")" source "${kubernetes_dir}/../../gha-run-k8s-common.sh" # shellcheck disable=2154 tools_dir="${repo_root_dir}/tools" +kata_tarball_dir="${2:-kata-artifacts}" DOCKER_REGISTRY=${DOCKER_REGISTRY:-quay.io} DOCKER_REPO=${DOCKER_REPO:-kata-containers/kata-deploy-ci} @@ -233,11 +234,6 @@ function cleanup() { kubectl delete -f "${tools_dir}/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml" } -install_kata_tools_placeholder() { - echo "Kata tools will be installed (for the genpolicy app)"\ - "after CI picks up the gha yaml changes required to test that installation." -} - function deploy_snapshotter() { echo "::group::Deploying ${SNAPSHOTTER:-}" #TODO Add the deployment logic for the snapshotter in PR https://github.com/kata-containers/kata-containers/pull/8585. @@ -265,7 +261,7 @@ function main() { setup-crio) setup_crio ;; deploy-k8s) deploy_k8s ;; install-bats) install_bats ;; - install-kata-tools) install_kata_tools_placeholder ;; + install-kata-tools) install_kata_tools ;; install-kubectl) install_kubectl ;; get-cluster-credentials) get_cluster_credentials ;; deploy-kata-aks) deploy_kata "aks" ;;