From e723440cabe40a9834d0c7253597cf440d7a51bd Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 15 Feb 2018 18:42:07 -0600 Subject: [PATCH] test: Add initial cri-containerd tests Run a few integration test and cri-tools tests Fixes: #916 Signed-off-by: Jose Carlos Venegas Munoz --- .ci/run.sh | 2 ++ Makefile | 3 ++ integration/cri-containerd/test.sh | 46 ++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100755 integration/cri-containerd/test.sh diff --git a/.ci/run.sh b/.ci/run.sh index 4593b471e..a0742f883 100755 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -41,6 +41,8 @@ fi sudo -E PATH="$PATH" bash -c "make check" +sudo -E PATH="$PATH" bash -c "make cri-containerd" + # Currently, Openshift tests only work on Fedora. # We should delete this condition, when it works for Ubuntu. if [ "$ID" == fedora ]; then diff --git a/Makefile b/Makefile index ac639b749..d40fb86e4 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,9 @@ all: functional checkcommits integration checkcommits: cd cmd/checkcommits && make +cri-containerd: + ./integration/cri-containerd/test.sh + clean: cd cmd/checkcommits && make clean diff --git a/integration/cri-containerd/test.sh b/integration/cri-containerd/test.sh new file mode 100755 index 000000000..e63d61c7f --- /dev/null +++ b/integration/cri-containerd/test.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# Copyright (c) 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +set -e + +repo="github.com/containerd/cri-containerd" +# FIXME: cri-containerd fails using macvtap. +sudo sed -r -i -e 's/^(internetworking_model=).*/\1"bridged"/g' /usr/share/defaults/clear-containers/configuration.toml + +pushd ${GOPATH}/src/${repo} + +FOCUS="runtime should support basic operations on container" CRI_CONTAINERD_FLAGS="--containerd-runtime-engine cc-runtime" make test-cri + +passing_test=( + TestClearContainersCreate + TestContainerStats + TestContainerListStatsWithIdFilter + TestContainerListStatsWithSandboxIdFilterd + TestContainerListStatsWithIdSandboxIdFilter + TestDuplicateName + TestImageLoad + TestImageFSInfo + TestSandboxCleanRemove + ) + +for t in "${passing_test[@]}" +do +CRI_CONTAINERD_FLAGS="--containerd-runtime-engine cc-runtime" FOCUS="${t}" make test-integration +done + +popd +