Refactor t_client.sh & improve output formatting
Ratio:
* Cleanup code
* Prepare for better automated integration tests (future)
Move global code into separate functions. Fixup formatting of code. Also add table output formatting to t_client.sh:
| ID | TEST | RESULT | | -- | ----------------------------------- | -------------------- | | 1 | testing tun/udp/ipv4 | [SUCCESS] | | 2 | testing tun/udp/ipv4 with pam | [FAIL: 5 fails] | | -- | ----------------------------------- | -------------------- |
Test sets succeded: 1.
Test sets failed: 2.
For easier review these patches have also been provided via GitHub pull request:
https://github.com/OpenVPN/openvpn/pull/49
Due to moving code around and intention changes this patch looks rather large:
1 file changed, 267 insertions(+), 180 deletions(-).
PATCH 1/2 Refactor t_client.sh
From: Jens Neuhalfen <[email protected]...>
Move global code into seperate functions. Fixup formatting of code.
--- tests/t_client.sh.in | 433 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 255 insertions(+), 178 deletions(-)
tests/t_client.sh.in +255 -178
@@ -12,6 +12,12 @@ # - for "ping6" checks: fping6 binary in $PATH # +# +# Tests are configured via t_client.rc in this direcotry or the top +# level source directroy. +# + + srcdir="${srcdir:-.}" top_builddir="${top_builddir:-..}" if [ -r "${top_builddir}"/t_client.rc ] ; then
@@ -85,7 +91,18 @@ else exit 1 fi -exit_code=0 +# ---------------------------------------------------------- +# global variables +# ---------------------------------------------------------- + +# list of succeeded tests (e.g. 1 2 3) +declare SUMMARY_OK="" + +# list of failed tests +declare SUMMARY_FAIL="" + +# number of failed checks for a test (# of calls to fail()) +declare -i fail_count=0 # ---------------------------------------------------------- # helper functions
@@ -105,46 +122,46 @@ get_ifconfig_route() # linux / iproute2? (-> if configure got a path) if [ -n "@IPROUTE@" ] then - echo "-- linux iproute2 --" - @IPROUTE@ addr show | grep -v valid_lft - @IPROUTE@ route show - @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g' - return + echo "-- linux iproute2 --" + @IPROUTE@ addr show | grep -v valid_lft + @IPROUTE@ route show + @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g' + return fi # try uname case `uname -s` in - Linux) - echo "-- linux / ifconfig --" - LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)" - LANG=C @NETSTAT@ -rn -4 -6 - return - ;; - FreeBSD|NetBSD|Darwin) - echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --" - @IFCONFIG@ -a | egrep "(flags=|inet)" - @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' - return - ;; - OpenBSD) - echo "-- OpenBSD --" - @IFCONFIG@ -a | egrep "(flags=|inet)" | \ - sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//' - @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' - return - ;; - SunOS) - echo "-- Solaris --" - @IFCONFIG@ -a | egrep "(flags=|inet)" - @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' - return - ;; - AIX) - echo "-- AIX --" - @IFCONFIG@ -a | egrep "(flags=|inet)" - @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' - return - ;; + Linux) + echo "-- linux / ifconfig --" + LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)" + LANG=C @NETSTAT@ -rn -4 -6 + return + ;; + FreeBSD|NetBSD|Darwin) + echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --" + @IFCONFIG@ -a | egrep "(flags=|inet)" + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' + return + ;; + OpenBSD) + echo "-- OpenBSD --" + @IFCONFIG@ -a | egrep "(flags=|inet)" | \ + sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//' + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' + return + ;; + SunOS) + echo "-- Solaris --" + @IFCONFIG@ -a | egrep "(flags=|inet)" + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' + return + ;; + AIX) + echo "-- AIX --" + @IFCONFIG@ -a | egrep "(flags=|inet)" + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' + return + ;; esac echo "get_ifconfig_route(): no idea how to get info on your OS. FAIL." >&2
@@ -164,11 +181,11 @@ check_ifconfig() for expect in $expect_list do - if get_ifconfig_route | fgrep "$expect" >/dev/null - then : - else - fail "check_ifconfig(): expected IPv$proto address '$expect' not found in ifconfig output." - fi + if get_ifconfig_route | fgrep "$expect" >/dev/null + then : + else + fail "check_ifconfig(): expected IPv$proto address '$expect' not found in ifconfig output." + fi done }
@@ -186,166 +203,226 @@ run_ping_tests() if [ -z "$targetlist" ] ; then return ; fi case $proto in - 4) cmd=fping ;; - 6) cmd=fping6 ;; - *) echo "internal error in run_ping_tests arg 1: '$proto'" >&2 - exit 1 ;; + 4) cmd=fping ;; + 6) cmd=fping6 ;; + *) echo "internal error in run_ping_tests arg 1: '$proto'" >&2 + exit 1 ;; esac case $want in - want_ok) sizes_list="64 1440 3000" ;; - want_fail) sizes_list="64" ;; + want_ok) sizes_list="64 1440 3000" ;; + want_fail) sizes_list="64" ;; esac for bytes in $sizes_list do - echo "run IPv$proto ping tests ($want), $bytes byte packets..." - - echo "$cmd -b $bytes -C 20 -p 250 -q $targetlist" >>$LOGDIR/$SUF:fping.out - $cmd -b $bytes -C 20 -p 250 -q $targetlist >>$LOGDIR/$SUF:fping.out 2>&1 - - # while OpenVPN is running, pings must succeed (want='want_ok') - # before OpenVPN is up, pings must NOT succeed (want='want_fail') - - rc=$? - if [ $rc = 0 ] # all ping OK - then - if [ $want = "want_fail" ] # not what we want - then - fail "IPv$proto ping test succeeded, but needs to *fail*." - fi - else # ping failed - if [ $want = "want_ok" ] # not what we wanted - then - fail "IPv$proto ping test ($bytes bytes) failed, but should succeed." - fi - fi + echo "run IPv$proto ping tests ($want), $bytes byte packets..." + + echo "$cmd -b $bytes -C 20 -p 250 -q $targetlist" >>$LOGDIR/$SUF:fping.out + $cmd -b $bytes -C 20 -p 250 -q $targetlist >>$LOGDIR/$SUF:fping.out 2>&1 + + # while OpenVPN is running, pings must succeed (want='want_ok') + # before OpenVPN is up, pings must NOT succeed (want='want_fail') + + rc=$? + if [ $rc = 0 ] # all ping OK + then + if [ $want = "want_fail" ] # not what we want + then + fail "IPv$proto ping test succeeded, but needs to *fail*." + fi + else # ping failed + if [ $want = "want_ok" ] # not what we wanted + then + fail "IPv$proto ping test ($bytes bytes) failed, but should succeed." + fi + fi done } +# # ---------------------------------------------------------- -# main test loop +# run single test # ---------------------------------------------------------- -SUMMARY_OK= -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\" - eval expect_ifconfig6=\"\$EXPECT_IFCONFIG6_$SUF\" - eval ping4_hosts=\"\$PING4_HOSTS_$SUF\" - eval ping6_hosts=\"\$PING6_HOSTS_$SUF\" - - 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 - - echo -e "\nrun pre-openvpn ping tests - targets must not be reachable..." - run_ping_tests 4 want_fail "$ping4_hosts" - run_ping_tests 6 want_fail "$ping6_hosts" - if [ "$fail_count" = 0 ] ; then - echo -e "OK.\n" - else - echo -e "FAIL: make sure that ping hosts are ONLY reachable via VPN, SKIP test $SUF". - exit_code=31 - continue - fi - - echo " run openvpn $openvpn_conf" - echo "# src/openvpn/openvpn $openvpn_conf" >$LOGDIR/$SUF:openvpn.log - $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log & - opid=$! - # make sure openvpn client is terminated in case shell exits - trap "$RUN_SUDO kill $opid" 0 - trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15 +run_test() { + # get config variables + test_prep="$1" + test_cleanup="$2" + test_run_title="$3" + openvpn_conf="$4" + expect_ifconfig4="$5" + expect_ifconfig6="$6" + ping4_hosts="$7" + ping6_hosts="$8" + + fail_count=0 + + echo -e "\n### test run $SUF: '$test_run_title' ###\n" + + 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 + + echo -e "\nrun pre-openvpn ping tests - targets must not be reachable..." + run_ping_tests 4 want_fail "$ping4_hosts" + run_ping_tests 6 want_fail "$ping6_hosts" + + if [ "$fail_count" = 0 ] ; then + echo -e "OK.\n" + else + echo -e "FAIL: make sure that ping hosts are ONLY reachable via VPN, SKIP test $SUF". + return 31 + fi + + echo " run openvpn $openvpn_conf" + echo "# src/openvpn/openvpn $openvpn_conf" >$LOGDIR/$SUF:openvpn.log + $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log & + opid=$! + + # make sure openvpn client is terminated in case shell exits + trap "$RUN_SUDO kill $opid" 0 + trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15 + + echo "wait for connection to establish..." + sleep ${SETUP_TIME_WAIT:-10} + + # test whether OpenVPN process is still there + if $RUN_SUDO kill -0 $opid + then : + else + echo -e "OpenVPN process has failed to start up, check log ($LOGDIR/$SUF:openvpn.log). FAIL.\ntail of logfile follows:\n..." >&2 + tail $LOGDIR/$SUF:openvpn.log >&2 + trap - 0 1 2 3 15 + return 10 + fi + + # compare whether anything changed in ifconfig/route setup? + echo "save ifconfig+route" + get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt + + echo -n "compare pre-openvpn ifconfig+route with current values..." + if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \ + $LOGDIR/$SUF:ifconfig_route.txt >/dev/null + then + fail "no differences between ifconfig/route before OpenVPN start and now." + else + echo -e " OK!\n" + fi + + # expected ifconfig values in there? + check_ifconfig 4 "$expect_ifconfig4" + check_ifconfig 6 "$expect_ifconfig6" + + run_ping_tests 4 want_ok "$ping4_hosts" + run_ping_tests 6 want_ok "$ping6_hosts" + echo -e "ping tests done.\n" + + echo "stopping OpenVPN" + $RUN_SUDO kill $opid + wait $! + rc=$? + if [ $rc != 0 ] ; then + fail "OpenVPN return code $rc, expect 0" + fi + + echo -e "\nsave post-openvpn ifconfig + route..." + get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_post.txt + + echo -n "compare pre- and post-openvpn ifconfig + route..." + if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \ + $LOGDIR/$SUF:ifconfig_route_post.txt >$LOGDIR/$SUF:ifconfig_route_diff.txt + then + echo -e " OK.\n" + else + cat $LOGDIR/$SUF:ifconfig_route_diff.txt >&2 + fail "differences between pre- and post-ifconfig/route" + fi + + if [ "$fail_count" = 0 ] ; then + echo -e "test run $SUF: all tests OK.\n" + else + echo -e "test run $SUF: $fail_count test failures. FAIL.\n"; + fi + + if [ -n "$test_cleanup" ]; then + echo -e "cleaning up: '$test_cleanup'" + eval $test_cleanup + fi + return $fail_count +} - echo "wait for connection to establish..." - sleep ${SETUP_TIME_WAIT:-10} - # test whether OpenVPN process is still there - if $RUN_SUDO kill -0 $opid - then : - else - echo -e "OpenVPN process has failed to start up, check log ($LOGDIR/$SUF:openvpn.log). FAIL.\ntail of logfile follows:\n..." >&2 - tail $LOGDIR/$SUF:openvpn.log >&2 - trap - 0 1 2 3 15 - exit 10 - fi +print_test_results(){ + # see here for an explanation on the calling convention: + # http://stackoverflow.com/questions/1063347/passing-arrays-as-parameters-in-bash + local -a test_ids=("${!1}") + local -a test_number_of_fails=("${!2}") - # compare whether anything changed in ifconfig/route setup? - echo "save ifconfig+route" - get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt + local summary_ok="" + local summary_fail="" - echo -n "compare pre-openvpn ifconfig+route with current values..." - if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \ - $LOGDIR/$SUF:ifconfig_route.txt >/dev/null - then - fail "no differences between ifconfig/route before OpenVPN start and now." - else - echo -e " OK!\n" - fi - - # expected ifconfig values in there? - check_ifconfig 4 "$expect_ifconfig4" - check_ifconfig 6 "$expect_ifconfig6" + for (( i = 0 ; i < ${#test_ids[@]} ; i++ )) do + if [ ${test_number_of_fails[$i]} == 0 ]; then + summary_ok="$summary_ok ${test_ids[$i]}" + else + summary_fail="$summary_fail ${test_ids[$i]}" + fi + done - run_ping_tests 4 want_ok "$ping4_hosts" - run_ping_tests 6 want_ok "$ping6_hosts" - echo -e "ping tests done.\n" + if [ -z "$summary_ok" ] ; then summary_ok=" none"; fi + if [ -z "$summary_fail" ] ; then summary_fail=" none"; fi + echo "Test sets succeded:$summary_ok." + echo "Test sets failed:$summary_fail." - echo "stopping OpenVPN" - $RUN_SUDO kill $opid - wait $! - rc=$? - if [ $rc != 0 ] ; then - fail "OpenVPN return code $rc, expect 0" - fi +} +# ---------------------------------------------------------- +# main test loop +# ---------------------------------------------------------- +run_test_loop() { + local test_run_list="$1" - echo -e "\nsave post-openvpn ifconfig + route..." - get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_post.txt + local -i any_test_failed=0 + local -i number_of_fails_in_test=0 + local -a test_ids + local -a test_number_of_fails + local -i current_test_index=0 - echo -n "compare pre- and post-openvpn ifconfig + route..." - if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \ - $LOGDIR/$SUF:ifconfig_route_post.txt >$LOGDIR/$SUF:ifconfig_route_diff.txt - then - echo -e " OK.\n" - else - cat $LOGDIR/$SUF:ifconfig_route_diff.txt >&2 - fail "differences between pre- and post-ifconfig/route" - fi - if [ "$fail_count" = 0 ] ; then - echo -e "test run $SUF: all tests OK.\n" - SUMMARY_OK="$SUMMARY_OK $SUF" - else - echo -e "test run $SUF: $fail_count test failures. FAIL.\n"; - SUMMARY_FAIL="$SUMMARY_FAIL $SUF" - exit_code=30 - fi + for SUF in $test_run_list + do + # get config variables from the sourced t_client.rc + 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\" + eval expect_ifconfig6=\"\$EXPECT_IFCONFIG6_$SUF\" + eval ping4_hosts=\"\$PING4_HOSTS_$SUF\" + eval ping6_hosts=\"\$PING6_HOSTS_$SUF\" + + test_ids[$current_test_index]="$SUF" + + run_test "$test_prep" "$test_cleanup" "$test_run_title" "$openvpn_conf" "$expect_ifconfig4" "$expect_ifconfig6" "$ping4_hosts" "$ping6_hosts" + number_of_fails_in_test=$? + test_results[$current_test_index]=$number_of_fails_in_test + + if [ $number_of_fails_in_test != 0 ]; then + any_test_failed=1 + fi + current_test_index=$((current_test_index + 1)) + done - if [ -n "$test_cleanup" ]; then - echo -e "cleaning up: '$test_cleanup'" - eval $test_cleanup - fi + print_test_results test_ids[@] test_results[@] -done + return $any_test_failed +} -if [ -z "$SUMMARY_OK" ] ; then SUMMARY_OK=" none"; fi -if [ -z "$SUMMARY_FAIL" ] ; then SUMMARY_FAIL=" none"; fi -echo "Test sets succeded:$SUMMARY_OK." -echo "Test sets failed:$SUMMARY_FAIL." +run_test_loop "$TEST_RUN_LIST" +exit_code=$? # remove trap handler trap - 0 1 2 3 15
Signature · 1 line
2.8.2
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi,
tests/t_client.sh.in else · line 105
Quoted 12 lines · On Sat, May 21, 2016 at 11:22:04AM +0200, [email protected]... wrote:
tests/t_client.sh.in +12
-0+# ---------------------------------------------------------- +# global variables +# ---------------------------------------------------------- + +# list of succeeded tests (e.g. 1 2 3) +declare SUMMARY_OK="" + +# list of failed tests +declare SUMMARY_FAIL="" + +# number of failed checks for a test (# of calls to fail()) +declare -i fail_count=0
Generally speaking, I'm in favour of reworking t_client.sh and making the output more readable, etc. - it was a quick hack, and more polishing would be welcome.
I'm not exactly sure about the shell constructs you use, specifically arrays and varaible declarations - is that posix shell, or "bash"?
This script needs to run on all platforms we support, and that includes more esoteric ones like AIX and Solaris - OpenSolaris /bin/sh is a ksh93 variant (nowadays), so if it works in ksh and dash (Debian /bin/sh), I'm fine...
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi Gert,
[snip]
Quoted 7 lines
Generally speaking, I'm in favour of reworking
t_client.shand making the output more readable, etc. - it was a quick hack, and more polishing would be welcome.I'm not exactly sure about the shell constructs you use, specifically arrays and varaible declarations - is that posix shell, or "bash"?
Quoted 6 lines
This script needs to run on all platforms we support, and that includes more esoteric ones like AIX and Solaris - OpenSolaris
/bin/shis a ksh93 variant (nowadays), so if it works in ksh and dash (Debian/bin/sh), I'm fine…gert
Arrays are indeed not POSIX compliant. Do we have some hard baseline of systems we need our tests to run on? I have SmartOS (Solaris derivate), I could get my hands on a Solaris VM (10 or 11, I’ll need to check with Oracles license) for local testing.
I have virtually no experience with AIX though.
As these tests are only run on development machines I assume that we can require some additional packages to be installed?
I’ll make sure that it works on
* Ubuntu Precise Pangolin
* Mac OS
* Solaris 11 (btw: Do we use gcc or Solaris Studio?)
Can you do a final test on AIX after I am done?
Cheers
Jens
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi,
Quoted 9 lines · Jens Neuhalfen
Quoted 4 lines
This script needs to run on all platforms we support, and that includes more esoteric ones like AIX and Solaris - OpenSolaris
/bin/shis a ksh93 variant (nowadays), so if it works in ksh and dash (Debian/bin/sh), I'm fine???Arrays are indeed not POSIX compliant. Do we have some hard baseline of systems we need our tests to run on? I have SmartOS (Solaris derivate), I could get my hands on a Solaris VM (10 or 11, I???ll need to check with Oracles license) for local testing.
My buildbots test on "all the BSDs" (Free, Net, Open, and they have a /bin/sh which is "It only supports features designated by POSIX plus a few Berkeley extensions") and OpenSolaris 11 (ksh93). Samuli's buildbot test on various Linux variants, so "dash" should work.
Quoted 1 line
I have virtually no experience with AIX though.
Generally speaking, AIX is major pains :-) - but the /bin/sh is a ksh, so if it works in ksh93, AIX should be fine.
Quoted 2 lines
As these tests are only run on development machines I assume that we can require some additional packages to be installed?
We already need fping/fping6 for t_client, so yes. Autoconf wants Perl, so if it makes sense to rewrite t_client.sh to use that, it might be another option (but we shouldn't require extra perl *modules*).
Quoted 5 lines
I???ll make sure that it works on
* Ubuntu Precise Pangolin
* Mac OS
* Solaris 11 (btw: Do we use gcc or Solaris Studio?)
If these all work, we should be in good shape - I was mostly worried about Solaris, but MacOS might have some surprises as well.
I compile using gcc on Solaris, but haven't received any reports about Solaris Studio *not* working - whatever that means ("nobody uses Solaris" or "it just works") :-)
Quoted 1 line
Can you do a final test on AIX after I am done?
Happy to. I can't give other people access to the AIX systems (customer), so can't run a buildslave there - but running openvpn tests is fine.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Gert, Samuli
[…]
Quoted 5 lines
My buildbots test on "all the BSDs" (Free, Net, Open, and they have a
/bin/shwhich is "It only supports features designated by POSIX plus a few Berkeley extensions") and OpenSolaris 11 (ksh93). Samuli's buildbot test on various Linux variants, so "dash" should work.
Are these buildbots available vor the general public? Being able to easily test lowers the bar for new contributors considerable.
[…]
Jens
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi,
Quoted 9 lines · Jens Neuhalfen
[???]
Quoted 4 lines
My buildbots test on "all the BSDs" (Free, Net, Open, and they have a
/bin/shwhich is "It only supports features designated by POSIX plus a few Berkeley extensions") and OpenSolaris 11 (ksh93). Samuli's buildbot test on various Linux variants, so "dash" should work.Are these buildbots available vor the general public? Being able to easily test lowers the bar for new contributors considerable.
Right now, not for "general public". They auto-build (+test) every release that gets commited to "master" - which, of course, means "it is too late if it breaks platform <x>".
We have discussed building from test branches (on-demand), and widening the access to these branches - but nothing specific has been decided yet. Maybe we should put that on the agenda for the monday meeting on May 30...
- addition of new branches (at github), with more liberal commit rights
- having the buildbots pull from github (right now they use sf, AFAIR)
- opening the buildbot "build revision <x> on platform <y>" API for a wider circle (right now, I think only Samuli, David and I have access to that host, it's on private addresses in Samuli's VPN)
I'm a bit reluctant giving "full user account" access rights to developers I have not met in person yet - but with the approach outlined above, at least sanity checking "I think the patch is good, will it break one of the more esoteric platforms?" will be possible.
Samuli, are you listening? ;-)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Quoted 28 lines
Hi,
Quoted 9 lines · Jens Neuhalfen
[???]
Quoted 4 lines
My buildbots test on "all the BSDs" (Free, Net, Open, and they have a
/bin/shwhich is "It only supports features designated by POSIX plus a few Berkeley extensions") and OpenSolaris 11 (ksh93). Samuli's buildbot test on various Linux variants, so "dash" should work.Are these buildbots available vor the general public? Being able to easily test lowers the bar for new contributors considerable.
Right now, not for "general public". They auto-build (+test) every release that gets commited to "master" - which, of course, means "it is too late if it breaks platform <x>".
We have discussed building from test branches (on-demand), and widening the access to these branches - but nothing specific has been decided yet. Maybe we should put that on the agenda for the monday meeting on May 30...
- addition of new branches (at github), with more liberal commit rights
- having the buildbots pull from github (right now they use sf, AFAIR)
- opening the buildbot "build revision <x> on platform <y>" API for a wider circle (right now, I think only Samuli, David and I have access to that host, it's on private addresses in Samuli's VPN)
Quoted 8 lines
I'm a bit reluctant giving "full user account" access rights to developers I have not met in person yet - but with the approach outlined above, at least sanity checking "I think the patch is good, will it break one of the more esoteric platforms?" will be possible.
Samuli, are you listening? ;-)
gert
Yes. I think a separate testing branch with more liberal commit rights combined with pulling from GitHub makes sense. I'm not sure what happens at the buildslaves if we decide rewind history - rewinding would be quite useful when working with pure testing branches in that we could make "testing" track master and whenever a bad patch is found, simply rewind back to the last known-good state.
I'd prefer to keep the actual buildslave infrastructure private, with access granted to only a select few. We already get email notifications to a public list for each build failure.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi,
Quoted 1 line
I'd prefer to keep the actual buildslave infrastructure private, with access granted to only a select few. We already get email notifications to a public list for each build failure.
Is there some kind of instruction to “reproduce” the build infrastructure? Some kind of document or - even better - something executable (Vagrant/Docker/Salt/Puppet/..)?
Jens
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Hi,
Quoted 3 lines · Jens Neuhalfen
Quoted 1 line
I'd prefer to keep the actual buildslave infrastructure private, with access granted to only a select few. We already get email notifications to a public list for each build failure.
Is there some kind of instruction to ?reproduce? the build infrastructure? Some kind of document or - even better - something executable (Vagrant/Docker/Salt/Puppet/..)?
https://community.openvpn.net/openvpn/wiki/SettingUpBuildslave
is what we currently have, but it only describes the slaves (talking to Samuli's build master) - not sure if the master is documented anywhere.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Quoted 4 lines
Hi,
On Mon, May 23, 2016 at 05:43:58PM +0200, Jens Neuhalfen wrote:
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
I'd prefer to keep the actual buildslave infrastructure private, with access granted to only a select few. We already get email notifications to a public list for each build failure.
Is there some kind of instruction to ?reproduce? the build infrastructure? Some kind of document or - even better - something executable (Vagrant/Docker/Salt/Puppet/..)?
https://community.openvpn.net/openvpn/wiki/SettingUpBuildslave
is what we currently have, but it only describes the slaves (talking to Samuli's build master) - not sure if the master is documented anywhere.
The buildmaster part is not documented anywhere. I have shared the master config once when someone requested it - there is nothing inherently private in there, once the passwords are removed. Setting up buildmaster + buildslaves could definitely be automated, but it would be a rather massive task.
I would suggest extending Travis CI instead of trying to create a private buildbot infrastructure. If *BSD is not supported by Travis, then we obviously can't get rid of buildbot entirely anytime soon. Plus we need the Windows "buildslave" (=custom scropt) for full cross-compile tests and for publishing snapshot installers thus produced.
Could we use Travis CI with a huge combination of operating systems and build flags? Or does this kind of use go outside its scope? Right now each commit triggers something like 150 builds on the buildslaves (in total).
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
...
Quoted 2 lines
The buildmaster part is not documented anywhere. I have shared the master config once when someone requested it - there is nothing inherently private in there, once the passwords are removed. Setting up buildmaster + buildslaves could definitely be automated, but it would be a rather massive task.
Samuli, could you send me the scripts? I’d like to have a look. Maybe there is something that can be replicated. This is something I’d try to add to the scripted integration tests (Vagrant) already in the pipeline.
[…]
Quoted 3 lines
Could we use Travis CI with a huge combination of operating systems and build flags? Or does this kind of use go outside its scope? Right now each commit triggers something like 150 builds on the buildslaves (in total).
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Quoted 7 lines
...
Quoted 2 lines
The buildmaster part is not documented anywhere. I have shared the master config once when someone requested it - there is nothing inherently private in there, once the passwords are removed. Setting up buildmaster + buildslaves could definitely be automated, but it would be a rather massive task.
Samuli, could you send me the scripts? I’d like to have a look. Maybe there is something that can be replicated. This is something I’d try to add to the scripted integration tests (Vagrant) already in the pipeline.
I published the Windows "buildslave" script here, along with some basic documentation:
<https://github.com/mattock/openvpn-windows-buildtest>
I also cleaned up the buildmaster configuration and will publish it later. However, there will be several hacks in there to accommodate quirks in our current buildslaves (e.g. NetBSD), so making it fully generic would require some refactoring.
Quoted 4 lines
Quoted 2 lines
Could we use Travis CI with a huge combination of operating systems and build flags? Or does this kind of use go outside its scope? Right now each commit triggers something like 150 builds on the buildslaves (in total).
From what I know, this is not possible. 150 build? Whoah, thats quite a few. I’d expect 2-3 per supported OS. Is this a case of combinatoric explosion?
Yeah. we trigger at least 16 builds per buildslave/OS, can't check the exact number right now. This is because of the large number of configure flags we need to support.
It seems that basic smoke testing with Travis CI before pushing anything to the repository makes sense, but it's not a full buildbot replacement.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Quoted 12 lines
Quoted 8 lines
...
Quoted 2 lines
The buildmaster part is not documented anywhere. I have shared the master config once when someone requested it - there is nothing inherently private in there, once the passwords are removed. Setting up buildmaster + buildslaves could definitely be automated, but it would be a rather massive task.
Samuli, could you send me the scripts? I’d like to have a look. Maybe there is something that can be replicated. This is something I’d try to add to the scripted integration tests (Vagrant) already in the pipeline.
I published the Windows "buildslave" script here, along with some basic documentation:
Quoted 7 lines
<https://github.com/mattock/openvpn-windows-buildtest>
I also cleaned up the buildmaster configuration and will publish it later. However, there will be several hacks in there to accommodate quirks in our current buildslaves (e.g. NetBSD), so making it fully generic would require some refactoring.
A cleaned up buildmaster configuration file is now here:
<https://github.com/mattock/openvpn-buildbot>
It could become genuinely useful outside the current buildbot infrastructure if the URLs, passwords and emails were be fetched from a separate file.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
In reply to Samuli SeppänenHi,
Quoted 6 lines · Samuli Seppänen
Yes. I think a separate testing branch with more liberal commit rights combined with pulling from GitHub makes sense. I'm not sure what happens at the buildslaves if we decide rewind history - rewinding would be quite useful when working with pure testing branches in that we could make "testing" track master and whenever a bad patch is found, simply rewind back to the last known-good state.
Isn't this what github pull requests + travis is supposed to give us? Of course, that currently only covers a rather small part (much less than the buildbot tests), but it's not that hard to expand that to at least a decent number of compile variations. That would give us useful smoke tests before looking at a single line of code.
(May I remind the list of
http://thread.gmane.org/gmane.network.openvpn.devel/10865, which got some comments from ciphitsine (see
http://thread.gmane.org/gmane.network.openvpn.devel/11557/focus=11585),
but was never really ACK'ed and applied.)
-Steffan
Re: [Openvpn-devel] [PATCH 1/2] Refactor t_client.sh
Travis CI supports Linux and MacOS X, no *BSD, no Windows, ...
2016-05-24 12:31 GMT+05:00 Steffan Karger <[email protected]...>:
Quoted 38 lines
Hi,
Quoted 6 lines · Samuli Seppänen
Yes. I think a separate testing branch with more liberal commit rights combined with pulling from GitHub makes sense. I'm not sure what happens at the buildslaves if we decide rewind history - rewinding would be quite useful when working with pure testing branches in that we could make "testing" track master and whenever a bad patch is found, simply rewind back to the last known-good state.
Isn't this what github pull requests + travis is supposed to give us? Of course, that currently only covers a rather small part (much less than the buildbot tests), but it's not that hard to expand that to at least a decent number of compile variations. That would give us useful smoke tests before looking at a single line of code.
(May I remind the list of
http://thread.gmane.org/gmane.network.openvpn.devel/10865, which got some comments from ciphitsine (see
http://thread.gmane.org/gmane.network.openvpn.devel/11557/focus=11585),
but was never really ACK'ed and applied.)-Steffan
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH 2/2 Add table output formatting to t_client.sh
In reply to [email protected]...From: Jens Neuhalfen <[email protected]...>
Test results will be printed in a tabular format, e.g.
| ID | TEST | RESULT | | -- | ----------------------------------- | -------------------- | | 1 | testing tun/udp/ipv4 | [SUCCESS] | | 2 | testing tun/udp/ipv4 with pam | [FAIL: 5 fails] | | -- | ----------------------------------- | -------------------- |
Test sets succeded: 1.
Test sets failed: 2.
--- tests/t_client.sh.in | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
tests/t_client.sh.in +14 -4
@@ -361,18 +361,26 @@ print_test_results(){ # see here for an explanation on the calling convention: # http://stackoverflow.com/questions/1063347/passing-arrays-as-parameters-in-bash local -a test_ids=("${!1}") - local -a test_number_of_fails=("${!2}") + local -a test_names=("${!2}") + local -a test_number_of_fails=("${!3}") local summary_ok="" local summary_fail="" - for (( i = 0 ; i < ${#test_ids[@]} ; i++ )) do - if [ ${test_number_of_fails[$i]} == 0 ]; then + local fmt="| %2s | %-35s | %-20s |\n" + + printf "$fmt" "ID" "TEST" "RESULT" + printf "$fmt" "--" "-----------------------------------" "--------------------" + for (( i = 0 ; i < ${#test_names[@]} ; i++ )) do + if [ ${test_number_of_fails[$i]} = 0 ]; then summary_ok="$summary_ok ${test_ids[$i]}" + printf "$fmt" "${test_ids[$i]}" "${test_names[$i]}" "[OK]" else summary_fail="$summary_fail ${test_ids[$i]}" + printf "$fmt" "${test_ids[$i]}" "${test_names[$i]}" "[FAIL: ${test_number_of_fails[$i]} fails]" fi done + printf "$fmt" "--" "-----------------------------------" "--------------------" if [ -z "$summary_ok" ] ; then summary_ok=" none"; fi if [ -z "$summary_fail" ] ; then summary_fail=" none"; fi
@@ -389,6 +397,7 @@ run_test_loop() { local -i any_test_failed=0 local -i number_of_fails_in_test=0 local -a test_ids + local -a test_names local -a test_number_of_fails local -i current_test_index=0
@@ -405,6 +414,7 @@ run_test_loop() { eval ping6_hosts=\"\$PING6_HOSTS_$SUF\" test_ids[$current_test_index]="$SUF" + test_names[$current_test_index]="$test_run_title" run_test "$test_prep" "$test_cleanup" "$test_run_title" "$openvpn_conf" "$expect_ifconfig4" "$expect_ifconfig6" "$ping4_hosts" "$ping6_hosts" number_of_fails_in_test=$?
@@ -416,7 +426,7 @@ run_test_loop() { current_test_index=$((current_test_index + 1)) done - print_test_results test_ids[@] test_results[@] + print_test_results test_ids[@] test_names[@] test_results[@] return $any_test_failed }
Signature · 1 line
2.8.2