diff --git a/.travis.yml b/.travis.yml index eb0ac112..14e73014 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,38 +5,38 @@ env: global: - use_codecov=true matrix: - - DOCKER_IMAGE=nmstate/centos8-nmstate-dev + - CONTAINER_IMAGE=nmstate/centos8-nmstate-dev testflags="--test-type integ --pytest-args='-x'" use_codecov=false use_coveralls=true - - DOCKER_IMAGE=nmstate/centos8-nmstate-dev + - CONTAINER_IMAGE=nmstate/centos8-nmstate-dev testflags="--test-type integ --pytest-args='-x' --copr networkmanager/NetworkManager-1.22-git" - - DOCKER_IMAGE=nmstate/centos8-nmstate-dev + - CONTAINER_IMAGE=nmstate/centos8-nmstate-dev testflags="--test-type integ --pytest-args='-x' --copr networkmanager/NetworkManager-master" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type integ --pytest-args='-x'" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type format" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type lint" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type unit_py36" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type unit_py37" - - DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type unit_py38" matrix: allow_failures: - - env: DOCKER_IMAGE=nmstate/centos8-nmstate-dev + - env: CONTAINER_IMAGE=nmstate/centos8-nmstate-dev testflags="--test-type integ --pytest-args='-x' --copr networkmanager/NetworkManager-master" - - env: DOCKER_IMAGE=nmstate/centos8-nmstate-dev + - env: CONTAINER_IMAGE=nmstate/centos8-nmstate-dev testflags="--test-type integ --pytest-args='-x' --copr networkmanager/NetworkManager-1.22-git" - - env: DOCKER_IMAGE=nmstate/fedora-nmstate-dev + - env: CONTAINER_IMAGE=nmstate/fedora-nmstate-dev testflags="--test-type integ --pytest-args='-x'" addons: @@ -52,7 +52,7 @@ services: - docker before_install: - - docker pull $DOCKER_IMAGE + - docker pull $CONTAINER_IMAGE script: - sudo modprobe openvswitch diff --git a/automation/README.md b/automation/README.md index a5a59226..de82f830 100644 --- a/automation/README.md +++ b/automation/README.md @@ -64,9 +64,9 @@ After closing the shell, the container will be removed. Alternatively it is possible to provide the `--debug-shell` command-line option. To specify a different container image for the tests, specify it with the -`DOCKER_IMAGE` variable: +`CONTAINER_IMAGE` variable: -`DOCKER_IMAGE=local/centos8-nmstate-dev debug_exit_shell=1 ./automation/run-tests.sh` +`CONTAINER_IMAGE=local/centos8-nmstate-dev debug_exit_shell=1 ./automation/run-tests.sh` It is also possible to pass extra arguments to PDB using the `nmstate_pytest_extra_args` variable or via `--pytest-args` command-line diff --git a/automation/run-tests.environment.yaml b/automation/run-tests.environment.yaml index f5ce7efd..a35f7222 100644 --- a/automation/run-tests.environment.yaml +++ b/automation/run-tests.environment.yaml @@ -1,7 +1,7 @@ --- - name: 'TEST_TYPE' value: 'integ' -- name: 'DOCKER_IMAGE' +- name: 'CONTAINER_IMAGE' value: 'nmstate/centos8-nmstate-dev' - name: 'CI' value: 'true' diff --git a/automation/run-tests.sh b/automation/run-tests.sh index 6292fa42..1579198a 100755 --- a/automation/run-tests.sh +++ b/automation/run-tests.sh @@ -74,8 +74,8 @@ function install_nmstate { function run_tests { if [ $TEST_TYPE == $TEST_TYPE_ALL ] || \ [ $TEST_TYPE == $TEST_TYPE_FORMAT ];then - if [[ $DOCKER_IMAGE == *"centos"* ]]; then - echo "Running formatter in $DOCKER_IMAGE container is not " \ + if [[ $CONTAINER_IMAGE == *"centos"* ]]; then + echo "Running formatter in $CONTAINER_IMAGE container is not " \ "support yet" else container_exec 'tox -e black' @@ -84,8 +84,8 @@ function run_tests { if [ $TEST_TYPE == $TEST_TYPE_ALL ] || \ [ $TEST_TYPE == $TEST_TYPE_LINT ];then - if [[ $DOCKER_IMAGE == *"centos"* ]]; then - echo "Running unit test in $DOCKER_IMAGE container is not " \ + if [[ $CONTAINER_IMAGE == *"centos"* ]]; then + echo "Running unit test in $CONTAINER_IMAGE container is not " \ "support yet" else container_exec 'tox -e flake8,pylint' @@ -94,8 +94,8 @@ function run_tests { if [ $TEST_TYPE == $TEST_TYPE_ALL ] || \ [ $TEST_TYPE == $TEST_TYPE_UNIT_PY36 ];then - if [[ $DOCKER_IMAGE == *"centos"* ]]; then - echo "Running unit test in $DOCKER_IMAGE container is not " \ + if [[ $CONTAINER_IMAGE == *"centos"* ]]; then + echo "Running unit test in $CONTAINER_IMAGE container is not " \ "support yet" else container_exec 'tox -e py36' @@ -104,8 +104,8 @@ function run_tests { if [ $TEST_TYPE == $TEST_TYPE_ALL ] || \ [ $TEST_TYPE == $TEST_TYPE_UNIT_PY37 ];then - if [[ $DOCKER_IMAGE == *"centos"* ]]; then - echo "Running unit test in $DOCKER_IMAGE container is not " \ + if [[ $CONTAINER_IMAGE == *"centos"* ]]; then + echo "Running unit test in $CONTAINER_IMAGE container is not " \ "support yet" else container_exec 'tox -e py37' @@ -114,8 +114,8 @@ function run_tests { if [ $TEST_TYPE == $TEST_TYPE_ALL ] || \ [ $TEST_TYPE == $TEST_TYPE_UNIT_PY38 ];then - if [[ $DOCKER_IMAGE == *"centos"* ]]; then - echo "Running unit test in $DOCKER_IMAGE container is not " \ + if [[ $CONTAINER_IMAGE == *"centos"* ]]; then + echo "Running unit test in $CONTAINER_IMAGE container is not " \ "support yet" else container_exec 'tox -e py38' @@ -240,7 +240,7 @@ while true; do TEST_TYPE="$1" ;; --el8) - DOCKER_IMAGE=$CENTOS_IMAGE_DEV + CONTAINER_IMAGE=$CENTOS_IMAGE_DEV ;; --artifacts-dir) shift @@ -272,7 +272,7 @@ while true; do done : ${TEST_TYPE:=$TEST_TYPE_ALL} -: ${DOCKER_IMAGE:=$FEDORA_IMAGE_DEV} +: ${CONTAINER_IMAGE:=$FEDORA_IMAGE_DEV} ${CONTAINER_CMD} --version && cat /etc/resolv.conf @@ -283,7 +283,7 @@ if [[ "$CI" == "true" ]];then fi mkdir -p $EXPORT_DIR -CONTAINER_ID="$(${CONTAINER_CMD} run --privileged -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v $PROJECT_PATH:$CONTAINER_WORKSPACE -v $EXPORT_DIR:$CONT_EXPORT_DIR $DOCKER_IMAGE)" +CONTAINER_ID="$(${CONTAINER_CMD} run --privileged -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v $PROJECT_PATH:$CONTAINER_WORKSPACE -v $EXPORT_DIR:$CONT_EXPORT_DIR $CONTAINER_IMAGE)" [ -n "$debug_exit_shell" ] && trap open_shell EXIT || trap run_exit EXIT if [[ -v copr_repo ]];then