2019-02-18 13:41:45 -08:00
|
|
|
#!/usr/bin/env bash
|
2016-11-29 21:21:53 -08:00
|
|
|
|
2019-02-18 13:41:45 -08:00
|
|
|
set -o pipefail -eux
|
2016-11-29 21:21:53 -08:00
|
|
|
|
2017-02-24 16:58:56 -08:00
|
|
|
declare -a args
|
2017-10-03 12:43:46 -07:00
|
|
|
IFS='/:' read -ra args <<< "$1"
|
2017-01-10 10:30:41 -08:00
|
|
|
|
2017-02-24 16:58:56 -08:00
|
|
|
version="${args[1]}"
|
2019-08-30 00:18:49 -07:00
|
|
|
group="${args[2]}"
|
2017-01-10 10:30:41 -08:00
|
|
|
|
2019-03-11 15:13:09 -07:00
|
|
|
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
|
2019-08-30 00:18:49 -07:00
|
|
|
timeout=60
|
2019-03-05 11:58:13 -08:00
|
|
|
else
|
2019-11-01 16:46:13 -07:00
|
|
|
timeout=15
|
2019-03-05 11:58:13 -08:00
|
|
|
fi
|
|
|
|
|
2019-08-30 00:18:49 -07:00
|
|
|
group1=()
|
|
|
|
group2=()
|
|
|
|
|
|
|
|
# create two groups by putting long running network tests into one group
|
|
|
|
# add or remove more network platforms as needed to balance the two groups
|
|
|
|
|
|
|
|
networks=(
|
|
|
|
f5
|
|
|
|
fortimanager
|
|
|
|
fortios
|
|
|
|
ios
|
|
|
|
junos
|
|
|
|
netact
|
|
|
|
netscaler
|
|
|
|
netvisor
|
|
|
|
nos
|
|
|
|
nso
|
|
|
|
nuage
|
|
|
|
nxos
|
|
|
|
onyx
|
|
|
|
opx
|
|
|
|
ovs
|
|
|
|
radware
|
|
|
|
routeros
|
|
|
|
slxos
|
|
|
|
voss
|
|
|
|
vyos
|
|
|
|
)
|
|
|
|
|
|
|
|
for network in "${networks[@]}"; do
|
|
|
|
group1+=(--exclude "test/units/modules/network/${network}/")
|
|
|
|
group2+=("test/units/modules/network/${network}/")
|
|
|
|
done
|
|
|
|
|
|
|
|
case "${group}" in
|
|
|
|
1) options=("${group1[@]}") ;;
|
|
|
|
2) options=("${group2[@]}") ;;
|
|
|
|
esac
|
|
|
|
|
2019-03-05 11:58:13 -08:00
|
|
|
ansible-test env --timeout "${timeout}" --color -v
|
|
|
|
|
2017-05-14 15:04:52 +08:00
|
|
|
# shellcheck disable=SC2086
|
2018-01-23 10:00:55 -08:00
|
|
|
ansible-test units --color -v --docker default --python "${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
|
2019-08-30 00:18:49 -07:00
|
|
|
"${options[@]}" \
|