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..8a4a6b141 --- /dev/null +++ b/integration/cri-containerd/test.sh @@ -0,0 +1,57 @@ +#!/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 -eE + +err_report() { + cat /tmp/test-cri/cri-containerd.log + cat /tmp/test-cri/containerd.log +} + +trap 'err_report' ERR + + +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 + +CRITEST=${GOPATH}/bin/critest +# make sure cri-containerd test install the proper installation for testing +rm -f "${CRITEST}" +pushd ${GOPATH}/src/${repo} + +sudo PATH="${PATH}" FOCUS="runtime should support basic operations on container" CRI_CONTAINERD_FLAGS="--containerd-runtime-engine cc-runtime --stream-port 10011" make test-cri + +passing_test=( + TestClearContainersCreate + TestContainerStats + TestContainerListStatsWithIdFilter + TestContainerListStatsWithSandboxIdFilterd + TestContainerListStatsWithIdSandboxIdFilter + TestDuplicateName + TestImageLoad + TestImageFSInfo + TestSandboxCleanRemove + ) + +for t in "${passing_test[@]}" +do +sudo PATH="${PATH}" CRI_CONTAINERD_FLAGS="--containerd-runtime-engine cc-runtime --stream-port 10011" FOCUS="${t}" make test-integration +done + +popd +