Fix up network testing on Shippable. (#67678)
This prepares for code coverage collection for initial setup of incidental test coverage.
This commit is contained in:
parent
dbaa421f9d
commit
a64b562071
26 changed files with 34 additions and 38 deletions
|
@ -63,7 +63,8 @@ matrix:
|
|||
- env: T=windows/2016/7
|
||||
- env: T=windows/2019/7
|
||||
|
||||
- env: T=network
|
||||
- env: T=ios/csr1000v/1
|
||||
- env: T=vyos/1.1.8/1
|
||||
|
||||
- env: T=aix/7.2/1
|
||||
- env: T=osx/10.11/1
|
||||
|
|
1
test/integration/targets/ios_file/aliases
Normal file
1
test/integration/targets/ios_file/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/ios/group1
|
1
test/integration/targets/ios_lacp/aliases
Normal file
1
test/integration/targets/ios_lacp/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/ios/group1
|
1
test/integration/targets/ios_lldp_global/aliases
Normal file
1
test/integration/targets/ios_lldp_global/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/ios/group1
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
1
test/integration/targets/vyos_firewall_rules/aliases
Normal file
1
test/integration/targets/vyos_firewall_rules/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
1
test/integration/targets/vyos_lldp_global/aliases
Normal file
1
test/integration/targets/vyos_lldp_global/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
1
test/integration/targets/vyos_lldp_interfaces/aliases
Normal file
1
test/integration/targets/vyos_lldp_interfaces/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
|
@ -1 +1 @@
|
|||
shippable/network
|
||||
shippable/vyos/group1
|
||||
|
|
1
test/integration/targets/vyos_static_routes/aliases
Normal file
1
test/integration/targets/vyos_static_routes/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
1
test/integration/targets/vyos_system/aliases
Normal file
1
test/integration/targets/vyos_system/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
shippable/vyos/group1
|
|
@ -1,2 +1,2 @@
|
|||
ios/csr1000v connection=local
|
||||
ios/csr1000v connection=network_cli
|
||||
vyos/1.1.8 connection=local
|
||||
|
|
1
test/utils/shippable/ios.sh
Symbolic link
1
test/utils/shippable/ios.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
network.sh
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
set -o pipefail -eux
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test network-integration --explain ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; }
|
||||
{ grep ' network-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/network.txt
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
if [ "${COVERAGE}" == "--coverage" ]; then
|
||||
# when on-demand coverage is enabled, force tests to run for all network platforms
|
||||
echo "coverage" > /tmp/network.txt
|
||||
platform="${args[0]}"
|
||||
version="${args[1]}"
|
||||
|
||||
if [ "${#args[@]}" -gt 2 ]; then
|
||||
target="shippable/${platform}/group${args[2]}/"
|
||||
else
|
||||
target="shippable/${platform}/"
|
||||
fi
|
||||
|
||||
target="shippable/network/"
|
||||
|
||||
stage="${S:-prod}"
|
||||
provider="${P:-default}"
|
||||
|
||||
|
@ -23,27 +24,9 @@ python_versions=(
|
|||
3.6
|
||||
)
|
||||
|
||||
if [ -s /tmp/network.txt ]; then
|
||||
echo "Detected changes requiring integration tests specific to networking:"
|
||||
cat /tmp/network.txt
|
||||
|
||||
echo "Running network integration tests for multiple platforms concurrently."
|
||||
|
||||
platforms=(
|
||||
--platform vyos/1.1.8
|
||||
)
|
||||
else
|
||||
echo "No changes requiring integration tests specific to networking were detected."
|
||||
echo "Running network integration tests for a single platform only."
|
||||
|
||||
platforms=(
|
||||
--platform vyos/1.1.8
|
||||
)
|
||||
fi
|
||||
|
||||
for version in "${python_versions[@]}"; do
|
||||
for python_version in "${python_versions[@]}"; do
|
||||
# terminate remote instances on the final python version tested
|
||||
if [ "${version}" = "${python_versions[-1]}" ]; then
|
||||
if [ "${python_version}" = "${python_versions[-1]}" ]; then
|
||||
terminate="always"
|
||||
else
|
||||
terminate="never"
|
||||
|
@ -51,7 +34,7 @@ for version in "${python_versions[@]}"; do
|
|||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test network-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
|
||||
"${platforms[@]}" \
|
||||
--docker default --python "${version}" \
|
||||
--platform "${platform}/${version}" \
|
||||
--docker default --python "${python_version}" \
|
||||
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
|
||||
done
|
||||
|
|
1
test/utils/shippable/vyos.sh
Symbolic link
1
test/utils/shippable/vyos.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
network.sh
|
Loading…
Reference in a new issue