From 95b8e8bea96d66b74473bcdaeb992d9a6d116dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 7 Jun 2026 22:11:45 +0200 Subject: [PATCH] tests: update remaining containerd callers for containerd 2.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/functional/vfio-ap/run.sh: - Source tests/common.bash so the schema helpers are available. - configure_containerd_for_runtime_rs: write kata-qemu-runtime-rs configuration via a conf.d drop-in. Schema >= 3 uses io.containerd.cri.v1.runtime; schema 2 uses io.containerd.grpc.v1.cri. The sandboxer field is emitted only for schema >= 3. tests/integration/nerdctl/gha-run.sh: - Fix "containerd config default" pipe: propagate PATH so the newly installed binary is found, suppress stdout, and call ensure_containerd_conf_d_rootful_api_sockets. tests/integration/kubernetes/gha-run.sh: - Fix jq filter for devmapper snapshotter (.version // 0 >= 3). - Add ensure_containerd_conf_d_rootful_api_sockets after config setup. tests/gha-run-k8s-common.sh: - Remove the redundant "containerd config default | sed" override; overwrite_containerd_config (called via check_containerd_config_for_kata) now handles SystemdCgroup and all other containerd config setup. Signed-off-by: Fabiano FidĂȘncio Assisted-by: Cursor --- tests/functional/vfio-ap/run.sh | 26 +++++++++++++++++++------ tests/gha-run-k8s-common.sh | 2 -- tests/integration/kubernetes/gha-run.sh | 6 ++++-- tests/integration/nerdctl/gha-run.sh | 3 ++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/tests/functional/vfio-ap/run.sh b/tests/functional/vfio-ap/run.sh index 0b93ba1e84..dd8c1adf3c 100755 --- a/tests/functional/vfio-ap/run.sh +++ b/tests/functional/vfio-ap/run.sh @@ -11,6 +11,8 @@ set -o pipefail set -o errtrace script_path=$(dirname "$0") +# shellcheck source=/dev/null +source "${script_path}/../../common.bash" registry_port="${REGISTRY_PORT:-5000}" registry_name="local-registry" container_engine="${container_engine:-docker}" @@ -236,7 +238,7 @@ run_test() { } configure_containerd_for_runtime_rs() { - local config_file="/etc/containerd/config.toml" + local vfio_rs_drop="/etc/containerd/conf.d/52-kata-ci-vfio-ap-qemu-runtime-rs.toml" sudo rm -f /usr/local/bin/containerd-shim-kata-qemu-runtime-rs-v2 \ "${runtime_config_base}/runtime-rs/configuration.toml" @@ -253,15 +255,27 @@ configure_containerd_for_runtime_rs() { sudo ln -sf "${runtime_config_base}/runtime-rs/configuration-qemu-runtime-rs.toml" \ "${runtime_config_base}/runtime-rs/configuration.toml" - if [[ ! -f "${config_file}" ]]; then + if [[ ! -f "/etc/containerd/config.toml" ]]; then echo "/etc/containerd/config.toml not found" >&2 exit 1 fi - if ! grep -q "kata-qemu-runtime-rs" "${config_file}"; then - cat <= 3 then .plugins["io.containerd.cri.v1.images"].snapshotter = "devmapper" else .plugins["io.containerd.grpc.v1.cri"].containerd.snapshotter = "devmapper" @@ -280,8 +280,10 @@ function run_tests() { # enabled. Therefore, use containerd's default settings instead of distro's defaults. Note that # the k8s test cluster nodes have their own containerd settings (created by kata-deploy), # independent from the local settings being created here. - sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null + PATH="${PATH}:/usr/local/bin:/usr/local/sbin" containerd config default | sudo tee /etc/containerd/config.toml > /dev/null echo "containerd config has been set to default" + ensure_containerd_conf_d_rootful_api_sockets + require_containerd_config_schema_v3_plus sudo systemctl restart containerd && sudo systemctl is-active containerd # Allow genpolicy to access the containerd image pull APIs without sudo. diff --git a/tests/integration/nerdctl/gha-run.sh b/tests/integration/nerdctl/gha-run.sh index 50af99792b..5790cae3de 100755 --- a/tests/integration/nerdctl/gha-run.sh +++ b/tests/integration/nerdctl/gha-run.sh @@ -53,7 +53,8 @@ function install_dependencies() { # Create the default containerd configuration sudo mkdir -p /etc/containerd - containerd config default > sudo tee /etc/containerd/config.toml + PATH="${PATH}:/usr/local/bin:/usr/local/sbin" containerd config default | sudo tee /etc/containerd/config.toml > /dev/null + ensure_containerd_conf_d_rootful_api_sockets sudo systemctl restart containerd }