From 4915605b20e5ddf3d23f03fc5e797ea5ee4de52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 16 Aug 2023 08:59:36 +0200 Subject: [PATCH] tests: common: Add install_nydus_snapshotter() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function will be used to download and install the nydus-snapshotter, and it follows the same pattern we already have introduced for downloading and installing another dependencies from GitHub. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 56a14b3950961bced5aebdbc876419df87dde192) --- tests/common.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/common.bash b/tests/common.bash index bffafacb1c..c6fbf71a78 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -425,6 +425,17 @@ function install_nydus() { rm -f "${tarball_name}" } +function install_nydus_snapshotter() { + version="${1}" + + project="containerd/nydus-snapshotter" + tarball_name="nydus-snapshotter-${version}-$(${repo_root_dir}/tests/kata-arch.sh).tgz" + + download_github_project_tarball "${project}" "${version}" "${tarball_name}" + sudo tar xfz "${tarball_name}" -C /usr/local/bin --strip-components=1 + rm -f "${tarball_name}" +} + # Convert architecture to the name used by golang function arch_to_golang() { local arch="$(uname -m)"