Skip to content

Commit

Permalink
add a new target to invoke tests using conu library
Browse files Browse the repository at this point in the history
Required-by: s2i-ruby-container#167

Signed-off-by: Tomas Tomecek <[email protected]>
  • Loading branch information
TomasTomecek committed Nov 16, 2018
1 parent 6e0d445 commit 7e2ddb3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ test: script_env += TEST_MODE=true
test: tag
VERSIONS="$(VERSIONS)" $(script_env) $(test)

.PHONY: test-with-conu
test-with-conu: script_env += TEST_CONU_MODE=true
test-with-conu: tag
VERSIONS="$(VERSIONS)" $(script_env) $(test)

.PHONY: test-openshift
test-openshift: script_env += TEST_OPENSHIFT_MODE=true
test-openshift: tag
Expand Down
21 changes: 21 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ for dir in ${VERSIONS}; do
VERSION=$dir test/run
fi

if [ -n "${TEST_CONU_MODE}" ]; then
if [[ -x test/run-conu ]]; then
docker run \
--net=host \
-e VERSION=$dir \
-e IMAGE_NAME \
--rm -v /dev:/dev:ro \
-v /var/lib/docker:/var/lib/docker:ro \
--security-opt label=disable \
--cap-add SYS_ADMIN \
-ti \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/src \
-w /src \
docker.io/usercont/conu:0.6.2 \
test/run-conu
else
echo "-> conu tests are not present, skipping"
fi
fi

if [ -n "${TEST_OPENSHIFT_MODE}" ]; then
if [[ -x test/run-openshift ]]; then
VERSION=$dir test/run-openshift
Expand Down

0 comments on commit 7e2ddb3

Please sign in to comment.