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 <[email protected]>
  • Loading branch information
jcvenegas committed Feb 16, 2018
1 parent 40c889f commit 4eeed4c
Show file tree
Hide file tree
Showing 3 changed files with 61 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
56 changes: 56 additions & 0 deletions integration/cri-containerd/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/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
}

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}

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
CRI_CONTAINERD_FLAGS="--containerd-runtime-engine cc-runtime --stream-port 10011" FOCUS="${t}" make test-integration
done

popd

0 comments on commit 4eeed4c

Please sign in to comment.