mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-13 07:04:58 +00:00
ci: run tests using kata snap
build, install and test kata containers snap package. Depends-on: github.com/kata-containers/tests#1454 fixes #428 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
1d603643e3
commit
58b799bf9d
@ -18,8 +18,3 @@ pushd "${tests_repo_dir}"
|
||||
popd
|
||||
|
||||
# This script will execute packaging tests suite
|
||||
|
||||
if [ "$ID" == ubuntu ]; then
|
||||
echo "Building snap image"
|
||||
make snap
|
||||
fi
|
||||
|
48
.ci/setup.sh
48
.ci/setup.sh
@ -11,16 +11,10 @@ set -o pipefail
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
SNAP_CI="${SNAP_CI:-false}"
|
||||
|
||||
echo "Setup script for packaging"
|
||||
|
||||
if [ "$ID" == ubuntu ]; then
|
||||
echo "Install snap dependencies"
|
||||
sudo apt-get install -y snapd snapcraft
|
||||
|
||||
echo "Install kernel dependencies"
|
||||
sudo -E apt install -y libelf-dev bc gcc
|
||||
fi
|
||||
|
||||
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
|
||||
export tests_repo_dir="$GOPATH/src/$tests_repo"
|
||||
|
||||
@ -38,6 +32,44 @@ clone_tests_repo()
|
||||
|
||||
clone_tests_repo
|
||||
|
||||
if [ "$SNAP_CI" == "true" ] && [ "$ID" == "ubuntu" ]; then
|
||||
# Do not install kata since we want to build, install and test the snap
|
||||
export INSTALL_KATA="no"
|
||||
|
||||
echo "Install snap dependencies"
|
||||
sudo apt-get install -y snapd snapcraft make
|
||||
|
||||
echo "Building snap image"
|
||||
make snap
|
||||
|
||||
echo "Install kata container snap"
|
||||
sudo snap install --dangerous --classic "$(basename kata-containers_*.snap)"
|
||||
|
||||
etc_confile="/etc/kata-containers/configuration.toml"
|
||||
usr_confile="/usr/share/defaults/kata-containers/configuration.toml"
|
||||
snap_confile="/snap/kata-containers/current/usr/share/defaults/kata-containers/configuration.toml"
|
||||
snap_bin_dir="/snap/kata-containers/current/usr/bin"
|
||||
|
||||
sudo rm -f /usr/local/bin/kata-runtime \
|
||||
/usr/bin/kata-runtime \
|
||||
/usr/local/bin/containerd-shim-kata-v2 \
|
||||
/usr/bin/containerd-shim-kata-v2 \
|
||||
"${etc_confile}" "${usr_confile}"
|
||||
|
||||
sudo ln -sf ${snap_bin_dir}/kata-runtime /usr/bin/kata-runtime
|
||||
sudo ln -sf ${snap_bin_dir}/kata-runtime /usr/local/bin/kata-runtime
|
||||
|
||||
sudo ln -sf ${snap_bin_dir}/containerd-shim-kata-v2 /usr/bin/containerd-shim-kata-v2
|
||||
sudo ln -sf ${snap_bin_dir}/containerd-shim-kata-v2 /usr/local/bin/containerd-shim-kata-v2
|
||||
|
||||
# copy configuration file since some tests modify it.
|
||||
sudo mkdir -p "$(dirname "${etc_confile}")" "$(dirname "${usr_confile}")"
|
||||
sudo cp "${snap_confile}" "${etc_confile}"
|
||||
sudo cp "${snap_confile}" "${usr_confile}"
|
||||
|
||||
"${tests_repo_dir}/cmd/container-manager/manage_ctr_mgr.sh" docker configure -r kata-runtime -f
|
||||
fi
|
||||
|
||||
pushd "${tests_repo_dir}"
|
||||
.ci/setup.sh
|
||||
popd
|
||||
|
Loading…
Reference in New Issue
Block a user