SCRIPT: run-regtests: avoid several calls to grep to test for features
grep is used in the arguments loops to check for features such as OPENSSL or LUA or services like prometheus-exporter. Let's just look for the words inside the list, which requires to prepend a delimitor at the beginning of the list and add one at the end.
This commit is contained in:
parent
969e7afa0d
commit
0b3eb81c6b
@ -197,7 +197,7 @@ _findtests() {
|
|||||||
IFS="|"; set -- $requiredoption; IFS=$OLDIFS; alternatives="$*"
|
IFS="|"; set -- $requiredoption; IFS=$OLDIFS; alternatives="$*"
|
||||||
found=
|
found=
|
||||||
for alt in $alternatives; do
|
for alt in $alternatives; do
|
||||||
if echo "$FEATURES" | grep -qw "\+$alt"; then
|
if [ -z "${FEATURES_PATTERN##* +$alt *}" ]; then
|
||||||
found=1;
|
found=1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -211,7 +211,7 @@ _findtests() {
|
|||||||
IFS="|"; set -- $requiredservice; IFS=$OLDIFS; alternatives="$*"
|
IFS="|"; set -- $requiredservice; IFS=$OLDIFS; alternatives="$*"
|
||||||
found=
|
found=
|
||||||
for alt in $alternatives; do
|
for alt in $alternatives; do
|
||||||
if echo "$SERVICES" | grep -qw "$alt"; then
|
if [ -z "${SERVICES_PATTERN##* $alt *}" ]; then
|
||||||
found=1;
|
found=1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -345,6 +345,9 @@ EOF
|
|||||||
HAPROXY_VERSION=$(echo $HAPROXY_VERSION | cut -d " " -f 3)
|
HAPROXY_VERSION=$(echo $HAPROXY_VERSION | cut -d " " -f 3)
|
||||||
echo "Testing with haproxy version: $HAPROXY_VERSION"
|
echo "Testing with haproxy version: $HAPROXY_VERSION"
|
||||||
|
|
||||||
|
FEATURES_PATTERN=" $FEATURES "
|
||||||
|
SERVICES_PATTERN=" $SERVICES "
|
||||||
|
|
||||||
TESTRUNDATETIME="$(date '+%Y-%m-%d_%H-%M-%S')"
|
TESTRUNDATETIME="$(date '+%Y-%m-%d_%H-%M-%S')"
|
||||||
|
|
||||||
mkdir -p "$TESTDIR" || exit 1
|
mkdir -p "$TESTDIR" || exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user