tests/installed: support TESTS filter

Lifted from rpm-ostree. Makes iterating on a single test much faster.
Example use:

    TESTS=label-selinux ./ostree/tests/installed/run.sh

Closes: #1442
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2018-02-01 22:07:36 +00:00 committed by Atomic Bot
parent 5cba67520e
commit 6b95d51132

View File

@ -4,6 +4,14 @@ set -xeuo pipefail
dn=$(dirname $0)
for tn in ${dn}/itest-*.sh; do
if [ -n "${TESTS+ }" ]; then
tbn=$(basename "$tn" .sh)
tbn=" ${tbn#itest-} "
if [[ " $TESTS " != *$tbn* ]]; then
echo "Skipping: ${tn}"
continue
fi
fi
echo Executing: ${tn}
${tn}
done