mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-09 00:42:51 -04:00
t_client.sh: Add prepare/cleanup possibilties for each test case
By adding PREPARE_$NUM and CLEANUP_$NUM variables containing command lines to execute before and after the test case is run. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1384615074-22345-1-git-send-email-dazo@users.sourceforge.net> URL: http://article.gmane.org/gmane.network.openvpn.devel/7990 Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
ebcd7549ac
commit
8fedf86aba
1 changed files with 13 additions and 0 deletions
|
|
@ -221,6 +221,8 @@ SUMMARY_FAIL=
|
|||
for SUF in $TEST_RUN_LIST
|
||||
do
|
||||
# get config variables
|
||||
eval test_prep=\"\$PREPARE_$SUF\"
|
||||
eval test_cleanup=\"\$CLEANUP_$SUF\"
|
||||
eval test_run_title=\"\$RUN_TITLE_$SUF\"
|
||||
eval openvpn_conf=\"\$OPENVPN_CONF_$SUF\"
|
||||
eval expect_ifconfig4=\"\$EXPECT_IFCONFIG4_$SUF\"
|
||||
|
|
@ -231,6 +233,11 @@ do
|
|||
echo -e "\n### test run $SUF: '$test_run_title' ###\n"
|
||||
fail_count=0
|
||||
|
||||
if [ -n "$test_prep" ]; then
|
||||
echo -e "running preparation: '$test_prep'"
|
||||
eval $test_prep
|
||||
fi
|
||||
|
||||
echo "save pre-openvpn ifconfig + route"
|
||||
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_pre.txt
|
||||
|
||||
|
|
@ -316,6 +323,12 @@ do
|
|||
SUMMARY_FAIL="$SUMMARY_FAIL $SUF"
|
||||
exit_code=30
|
||||
fi
|
||||
|
||||
if [ -n "$test_cleanup" ]; then
|
||||
echo -e "cleaning up: '$test_cleanup'"
|
||||
eval $test_cleanup
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
if [ -z "$SUMMARY_OK" ] ; then SUMMARY_OK=" none"; fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue