mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
cmake: add custom targets docker-run-${DOCKER_INDEX}
This commit is contained in:
@@ -208,6 +208,16 @@ foreach(x RANGE ${DIST_LISTLEN})
|
|||||||
--add-host=ip6-localhost:::1
|
--add-host=ip6-localhost:::1
|
||||||
${DOCKER_IMAGE} /mscp/scripts/test-in-container.sh)
|
${DOCKER_IMAGE} /mscp/scripts/test-in-container.sh)
|
||||||
|
|
||||||
|
add_custom_target(docker-run-${DOCKER_INDEX}
|
||||||
|
COMMENT "Start ${DOCKER_IMAGE} container"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
COMMAND
|
||||||
|
${CE} run --init --rm --privileged
|
||||||
|
--sysctl net.ipv6.conf.all.disable_ipv6=0
|
||||||
|
--add-host=ip6-localhost:::1
|
||||||
|
-it
|
||||||
|
${DOCKER_IMAGE} /mscp/scripts/test-in-container.sh bash)
|
||||||
|
|
||||||
list(APPEND DOCKER_BUILDS docker-build-${DOCKER_INDEX})
|
list(APPEND DOCKER_BUILDS docker-build-${DOCKER_INDEX})
|
||||||
list(APPEND DOCKER_BUILDS_NO_CACHE docker-build-${DOCKER_INDEX}-no-cache)
|
list(APPEND DOCKER_BUILDS_NO_CACHE docker-build-${DOCKER_INDEX}-no-cache)
|
||||||
list(APPEND DOCKER_TESTS docker-test-${DOCKER_INDEX})
|
list(APPEND DOCKER_TESTS docker-test-${DOCKER_INDEX})
|
||||||
|
|||||||
@@ -28,5 +28,11 @@ for port in 22 8022; do
|
|||||||
ssh-keyscan -p $port ::1 >> ${HOME}/.ssh/known_hosts
|
ssh-keyscan -p $port ::1 >> ${HOME}/.ssh/known_hosts
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run test
|
|
||||||
python3 -m pytest -v ../test
|
if [ $# -gt 0 ]; then
|
||||||
|
# command arguments are passed, exec them
|
||||||
|
"$@"
|
||||||
|
else
|
||||||
|
# no arguments passed, run the test
|
||||||
|
python3 -m pytest -v ../test
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user