jenkins/kola/packet.sh: fix check for skipping machine type tests

The cl.basic and cl.internet tests are different tests which wasn't
clear before. Also, the grep process returns an exit code of 1 if it
didn't find a match, causing the job to cancel. The list of tests is
space separated and should not be quoted but on the other hand, we
do have to handle a literal *.
Look for the right test and handle the grep exit code, and disable
globs for the subshell for preserving a literal *.
This commit is contained in:
Kai Lueke 2021-09-30 11:43:22 +02:00
parent 3bbd7221c7
commit e24c456889

View File

@ -31,9 +31,9 @@ if [[ "${KOLA_TESTS}" == "" ]]; then
KOLA_TESTS="*" KOLA_TESTS="*"
fi fi
# cl.basic includes cl.internet which is run on multiple instance types # Run the cl.internet test on multiple machine types only if it should run in general
cl_basic_included="$(bin/kola list --platform=packet --filter "${KOLA_TESTS}" | grep cl.basic)" cl_internet_included="$(set -o noglob; bin/kola list --platform=packet --filter ${KOLA_TESTS} | { grep cl.internet || true ; } )"
if [[ "${BOARD}" == "amd64-usr" ]] && [[ "${cl_basic_included}" != "" ]]; then if [[ "${BOARD}" == "amd64-usr" ]] && [[ "${cl_internet_included}" != "" ]]; then
for INSTANCE in c3.small.x86 c3.medium.x86 m3.large.x86 s3.xlarge.x86 n2.xlarge.x86; do for INSTANCE in c3.small.x86 c3.medium.x86 m3.large.x86 s3.xlarge.x86 n2.xlarge.x86; do
( (
OUTPUT=$(timeout --signal=SIGQUIT "${timeout}" bin/kola run \ OUTPUT=$(timeout --signal=SIGQUIT "${timeout}" bin/kola run \