From 98e9434be46f39a3a33719d08454e4fcffe491ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 27 Sep 2023 11:04:14 +0200 Subject: [PATCH] ci: Add install_cni_plugins helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will become handy when doing tests with CRI-O, as CRI-O doesn't install the CNI plugins for us. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 64a20008590b8935a9c42c8d54b3cf71641fb0ea) --- tests/common.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/common.bash b/tests/common.bash index 20330a981d..19f57ab0c5 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -403,6 +403,19 @@ function download_github_project_tarball() { wget https://github.com/${project}/releases/download/${version}/${tarball_name} } +# version: The version to be intalled +function install_cni_plugins() { + version="${1}" + + project="containernetworking/plugins" + tarball_name="cni-plugins-linux-$(${repo_root_dir}/tests/kata-arch.sh -g)-${version}.tgz" + + download_github_project_tarball "${project}" "${version}" "${tarball_name}" + sudo mkdir -p /opt/cni/bin + sudo tar -xvf "${tarball_name}" -C /opt/cni/bin + rm -f "${tarball_name}" +} + # base_version: The version to be intalled in the ${major}.${minor} format function install_cri_containerd() { base_version="${1}"