ansible/test/utils/shippable/incidental/network.sh
Matt Clay 4e571248a9
First batch of incidental integration tests. (#67717)
* Initial copy of incidental network tests.

* Update incidental test aliases.

* Add incidental tests to CI.

* Rewrite module references in tests.

This should not be necessary once module redirection is supported.

* Rewrite target references for renamed targets.

* Add support collections for incidental tests.

* Add ignores for test support code.

* Remove echo used for debugging.
2020-02-24 17:31:14 -08:00

46 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
platform="${args[0]}"
version="${args[1]}"
python_version="${args[2]}"
target="shippable/${platform}/incidental/"
stage="${S:-prod}"
provider="${P:-default}"
# python versions to test in order
# all versions run full tests
python_versions=(
2.7
3.6
)
if [ "${python_version}" ]; then
# limit tests to a single python version
python_versions=("${python_version}")
fi
for python_version in "${python_versions[@]}"; do
# terminate remote instances on the final python version tested
if [ "${python_version}" = "${python_versions[-1]}" ]; then
terminate="always"
else
terminate="never"
fi
# shellcheck disable=SC2086
ansible-test network-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--platform "${platform}/${version}" \
--platform-connection "${platform}=ansible.netcommon.network_cli" \
--platform-collection "vyos=vyos.vyos" \
--platform-collection "ios=cisco.ios" \
--enable-test-support \
--docker default --python "${python_version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
done