[S] Change in openvpn[master]: t_client.sh.in: Add ability to filter by test group
"cron2 \(Code Review\) via Openvpn-devel" <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <[email protected]> |
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1777?usp=email ) Change subject: t_client.sh.in: Add ability to filter by test group ...................................................................... t_client.sh.in: Add ability to filter by test group Since we generally set this up in a way that one test group corresponds to one server, it can be useful to filter by the group. E.g. this allows one to potentially parallelize test runs against different servers. Change-Id: I4ebeb8c1f0f942da9b2e25f18f88566f8372fabf Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1777 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg38757.html Signed-off-by: Gert Doering <[email protected]> --- M tests/t_client.rc-sample M tests/t_client.sh.in 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/tests/t_client.rc-sample b/tests/t_client.rc-sample index 4c87436..defa4aa 100644 --- a/tests/t_client.rc-sample +++ b/tests/t_client.rc-sample @@ -31,6 +31,21 @@ # # tests to run (list suffixes for config stanzas below) # +# The general idea is to use one number per server, so +# e.g. use 1 for all tests talking to a UDP server, use +# 2 for tests talking to a TCP server, and 3 for tests +# talking to a P2P server. +# +# The indivdiual tests should then be indexed by using +# letters. +# +# If you set TEST_RUN_GROUP=<number> then t_client.sh +# will only run tests starting with that number. So +# e.g. setting TEST_RUN_GROUP=1 will run 1 and 1a, but +# not 2. This can be used to excercise only a specific +# server, or to run tests against separate servers in +# parallel. +# TEST_RUN_LIST="1 2 2n" # diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in index c3a9655..0568007 100755 --- a/tests/t_client.sh.in +++ b/tests/t_client.sh.in @@ -82,6 +82,21 @@ exit "${TCLIENT_SKIP_RC}" fi +if [ -n "$TEST_RUN_GROUP" ]; then + FILTERED_LIST= + for test in $TEST_RUN_LIST; do + group=$(echo $test | sed -E 's/^([0123456789]+).*/\1/') + if [ "$group" = "$TEST_RUN_GROUP" ]; then + FILTERED_LIST="$FILTERED_LIST $test" + fi + done + if [ -z "$FILTERED_LIST" ]; then + echo "Filtered TEST_RUN_LIST empty (group=$TEST_RUN_GROUP), no tests defined. SKIP test." >&2 + exit "${TCLIENT_SKIP_RC}" + fi + TEST_RUN_LIST=$FILTERED_LIST +fi + # Ensure PREFER_KSU is in a known state PREFER_KSU="${PREFER_KSU:-0}" @@ -121,6 +136,9 @@ fi LOGDIR=t_client-$(hostname)-$(date +%Y%m%d-%H%M%S) +if [ -n "$TEST_RUN_GROUP" ]; then + LOGDIR="${LOGDIR}-${TEST_RUN_GROUP}" +fi LOGDIR_ABS="$PWD/$LOGDIR" if mkdir $LOGDIR; then : -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1777?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4ebeb8c1f0f942da9b2e25f18f88566f8372fabf Gerrit-Change-Number: 1777 Gerrit-PatchSet: 8 Gerrit-Owner: flichtenheld <[email protected]> Gerrit-Reviewer: cron2 <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-Reviewer: razvanc <[email protected]> Gerrit-CC: openvpn-devel <[email protected]> _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel