Skip to content

Commit

Permalink
test: Add initial cri-containerd tests
Browse files Browse the repository at this point in the history
Run a few integration test and cri-tools tests

Fixes: clearcontainers#916

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Feb 16, 2018
1 parent 7c83fdd commit e723440
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
46 changes: 46 additions & 0 deletions integration/cri-containerd/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e723440

Please sign in to comment.