[Openvpn-devel] [S] Change in openvpn[master]: Change default of "topology" to "subnet"

2024-04-03 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#3) to the change originally created by 
flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/421?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos


Change subject: Change default of "topology" to "subnet"
..

Change default of "topology" to "subnet"

Change-Id: Iede3e7c028cbb715e28bc88c7e583f84dadc02c8
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231201112022.15337-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27627.html
Signed-off-by: Gert Doering 
---
M Changes.rst
M doc/man-sections/vpn-network-options.rst
M src/openvpn/options.c
3 files changed, 19 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/421/3

diff --git a/Changes.rst b/Changes.rst
index 54e5980..b2278ab 100644
--- a/Changes.rst
+++ b/Changes.rst
@@ -23,6 +23,15 @@
 ``persist-key`` option has been enabled by default.
 All the keys will be kept in memory across restart.

+Default for ``--topology`` changed to ``subnet``
+Previous releases used ``net30`` as default. This only affects
+configs with ``--dev tun`` and only IPv4. Note that this
+changes the semantics of ``--ifconfig``, so if you have manual
+settings for that in your config but not set ``--topology``
+your config might fail to parse with the new version. Just adding
+``--topology net30`` to the config should fix the problem.
+By default ``--topology`` is pushed from server to client.
+
 Overview of changes in 2.6
 ==

diff --git a/doc/man-sections/vpn-network-options.rst 
b/doc/man-sections/vpn-network-options.rst
index abe474f..98b4971 100644
--- a/doc/man-sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn-network-options.rst
@@ -495,11 +495,17 @@

   ``mode`` can be one of:

+  :code:`subnet`
+Use a subnet rather than a point-to-point topology by
+configuring the tun interface with a local IP address and subnet mask,
+similar to the topology used in ``--dev tap`` and ethernet bridging
+mode. This mode allocates a single IP address per connecting client and
+works on Windows as well. This is the default.
+
   :code:`net30`
 Use a point-to-point topology, by allocating one /30 subnet
 per client. This is designed to allow point-to-point semantics when some
-or all of the connecting clients might be Windows systems. This is the
-default.
+or all of the connecting clients might be Windows systems.

   :code:`p2p`
 Use a point-to-point topology where the remote endpoint of
@@ -508,15 +514,8 @@
 connecting client. Only use when none of the connecting clients are
 Windows systems.

-  :code:`subnet`
-Use a subnet rather than a point-to-point topology by
-configuring the tun interface with a local IP address and subnet mask,
-similar to the topology used in ``--dev tap`` and ethernet bridging
-mode. This mode allocates a single IP address per connecting client and
-works on Windows as well.
-
   *Note:* Using ``--topology subnet`` changes the interpretation of the
-  arguments of ``--ifconfig`` to mean "address netmask", no longer "local
+  arguments of ``--ifconfig`` to mean "address netmask", and not "local
   remote".

 --tun-mtu args
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 768332d..e2bfe0e 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -796,7 +796,7 @@
 o->gc_owned = true;
 }
 o->mode = MODE_POINT_TO_POINT;
-o->topology = TOP_NET30;
+o->topology = TOP_SUBNET;
 o->ce.proto = PROTO_UDP;
 o->ce.af = AF_UNSPEC;
 o->ce.bind_ipv6_only = false;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/421?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iede3e7c028cbb715e28bc88c7e583f84dadc02c8
Gerrit-Change-Number: 421
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Change default of "topology" to "subnet"

2024-04-03 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/421?usp=email )

Change subject: Change default of "topology" to "subnet"
..

Change default of "topology" to "subnet"

Change-Id: Iede3e7c028cbb715e28bc88c7e583f84dadc02c8
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231201112022.15337-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27627.html
Signed-off-by: Gert Doering 
---
M Changes.rst
M doc/man-sections/vpn-network-options.rst
M src/openvpn/options.c
3 files changed, 19 insertions(+), 11 deletions(-)




diff --git a/Changes.rst b/Changes.rst
index 54e5980..b2278ab 100644
--- a/Changes.rst
+++ b/Changes.rst
@@ -23,6 +23,15 @@
 ``persist-key`` option has been enabled by default.
 All the keys will be kept in memory across restart.

+Default for ``--topology`` changed to ``subnet``
+Previous releases used ``net30`` as default. This only affects
+configs with ``--dev tun`` and only IPv4. Note that this
+changes the semantics of ``--ifconfig``, so if you have manual
+settings for that in your config but not set ``--topology``
+your config might fail to parse with the new version. Just adding
+``--topology net30`` to the config should fix the problem.
+By default ``--topology`` is pushed from server to client.
+
 Overview of changes in 2.6
 ==

diff --git a/doc/man-sections/vpn-network-options.rst 
b/doc/man-sections/vpn-network-options.rst
index abe474f..98b4971 100644
--- a/doc/man-sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn-network-options.rst
@@ -495,11 +495,17 @@

   ``mode`` can be one of:

+  :code:`subnet`
+Use a subnet rather than a point-to-point topology by
+configuring the tun interface with a local IP address and subnet mask,
+similar to the topology used in ``--dev tap`` and ethernet bridging
+mode. This mode allocates a single IP address per connecting client and
+works on Windows as well. This is the default.
+
   :code:`net30`
 Use a point-to-point topology, by allocating one /30 subnet
 per client. This is designed to allow point-to-point semantics when some
-or all of the connecting clients might be Windows systems. This is the
-default.
+or all of the connecting clients might be Windows systems.

   :code:`p2p`
 Use a point-to-point topology where the remote endpoint of
@@ -508,15 +514,8 @@
 connecting client. Only use when none of the connecting clients are
 Windows systems.

-  :code:`subnet`
-Use a subnet rather than a point-to-point topology by
-configuring the tun interface with a local IP address and subnet mask,
-similar to the topology used in ``--dev tap`` and ethernet bridging
-mode. This mode allocates a single IP address per connecting client and
-works on Windows as well.
-
   *Note:* Using ``--topology subnet`` changes the interpretation of the
-  arguments of ``--ifconfig`` to mean "address netmask", no longer "local
+  arguments of ``--ifconfig`` to mean "address netmask", and not "local
   remote".

 --tun-mtu args
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 768332d..e2bfe0e 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -796,7 +796,7 @@
 o->gc_owned = true;
 }
 o->mode = MODE_POINT_TO_POINT;
-o->topology = TOP_NET30;
+o->topology = TOP_SUBNET;
 o->ce.proto = PROTO_UDP;
 o->ce.af = AF_UNSPEC;
 o->ce.bind_ipv6_only = false;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/421?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iede3e7c028cbb715e28bc88c7e583f84dadc02c8
Gerrit-Change-Number: 421
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Change default of topology to subnet

2024-04-03 Thread Gert Doering
Sorry for being so slow in merging this.  I had to adjust my testbeds
to "not explode" and shied away from doing so :-) (all the server test
instances without "topology" defaulted to net30, and just applying this
patch would recreate the ip-pool-persist files, breaking t_client
EXPECT_IFCONFIG4_... settings).

So.

Whoever reads this - *THIS CAN BE DISRUPTIVE*.  But it's the right
way forward, given that DCO (on the server) will only work with
"--topology subnet", and it also saves on IPv4 address usage for
the pools...  and clients have been compatible with "subnet" across
all platforms since at least OpenVPN 2.2, so no excuses.


NOTE: for --server setups, this will still work, just changing the way
the pool is split, thus assigning new IP addresses to clients, and
invalidating the --ip-pool-persist file.

NOTE2: For p2p setups (no --server, just --tls-server/--tls-client or
even --secret) it will break the setup hard, as those usually use 
"--ifconfig ip1 ip2" and "ip2" will now be parsed as a netmask, with
surprising consequences.  See GH #529.


Your patch has been applied to the master branch.

commit 32e6586687a548174b88b64fe54bfae6c74d4c19
Author: Frank Lichtenheld
Date:   Fri Dec 1 12:20:22 2023 +0100

 Change default of topology to subnet

 Signed-off-by: Frank Lichtenheld 
 Acked-by: Arne Schwabe 
 Message-Id: <20231201112022.15337-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27627.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] IRC community meeting summary

2024-04-03 Thread Johan Draaisma

Meeting summary for 3 April 2024:

 * *New: live route update feature*
   /A client implementation will be added to OpenVPN3 core soonish./
   /Obviously we'll need a spec that can be agreed on for this feature./
   /And ideally also an openvpn2 implementation (client+server)./
   /lev will put together a spec proposal for next meeting./

 * *Updated: website release process*
   /Waiting for faster way to update community downloads and security
   advisories on main site./
   /Again postponed due to issues. Now planned for this week. We'll see./

 * *Updated: forums topics*
   /ecrist still working on forums. a DNS record for the future archive
   address will be added, rob0 is doing this./
   /Plan is to soon switch URLs so new forum is on forums.openvpn.net
   and old forums is on archive address./
   /- email confirmation on registration was suggested./
   /- we still need to work on having some other people with some admin
   or high mod access./
   /- mod guide, hard or soft delete (chuck board?), what to do with
   GDPR, etc. (write it down and actually make it available to mods,
   maybe a hidden topic)/
   /- access for mods to logs so one can see what others did/

 * *Updated: mattock topics*
   /Separated test data from code in --dev null tests./
   /Also started on debian snapshot publishing but didn't get very far
   there yet./
   /Will next look at remove sudo root requirement from --dev null
   server-side./
   /Figure out if reliability can be increased further (i.e. why did it
   fail 4 out of 500 times)./

 * *Closed: when to deprecate weak ciphers*
   /Weak ciphers like 3DES and BF-CBC - what to do with them and when?/
   /Originally it looks like it was planned to remove in 2.7 but that
   may be too soon./
   /For example OpenVPN Inc. still sees customers with 10+ year old
   installations fairly regularly./
   /A proposal to consider may be to deprecate it when crypto libraries
   deprecate it./
   /Weighing the expected complaints versus the low cost of just
   maintaining weak ciphers until crypto libraries deprecate them - the
   choice seems obvious./
   /For now we'll stick with letting weak ciphers stay in unless there
   is some convincing reason to remove it./

As always you're welcome to join at #openvpn-meeting on Libera IRC 
network every Wednesday at 13:00 Central European Time.


Kind regards,
Johan Draaisma
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: tests: fork default automake test-driver

2024-04-03 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/478?usp=email )

Change subject: tests: fork default automake test-driver
..

tests: fork default automake test-driver

For some of the test we don't like the default log behavior
and there seems no easy way to change that except to fork
the driver. The license seems unproblematic since we're
GPL anyway.

v2:
 - Do not use forked-test-driver for UTs. Default behavior
   is fine for those.

Change-Id: I67d461afbcc9c06b1fc5ab4477141d7b8bd9ba8e
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20240125110036.16070-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28132.html
Signed-off-by: Gert Doering 
---
M Makefile.am
A forked-test-driver
M tests/Makefile.am
3 files changed, 156 insertions(+), 1 deletion(-)




diff --git a/Makefile.am b/Makefile.am
index 439346e..87230fe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,7 +45,8 @@
ltrc.inc \
CMakeLists.txt \
CMakePresets.json \
-   config.h.cmake.in
+   config.h.cmake.in \
+   forked-test-driver

 .PHONY: config-version.h doxygen

diff --git a/forked-test-driver b/forked-test-driver
new file mode 100755
index 000..be73b80
--- /dev/null
+++ b/forked-test-driver
@@ -0,0 +1,153 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to  or send patches to
+# .
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <"$log_file"
+"$@" >>"$log_file" 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2885752..5e9ad0a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,7 @@
 SUBDIRS = unit_tests

 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) System Tests'
+LOG_DRIVER = $(SHELL) $(top_srcdir)/forked-test-driver

 if !WIN32
 test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/478?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I67d461afbcc9c06b1fc5ab4477141d7b8bd9ba8e
Gerrit-Change-Number: 478
Gerrit-PatchSet: 11
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: 

[Openvpn-devel] [XS] Change in openvpn[master]: forked-test-driver: Show test output always

2024-04-03 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/479?usp=email )

Change subject: forked-test-driver: Show test output always
..

forked-test-driver: Show test output always

We want to see the progress, at least for slow tests
like t_client.sh.

Change-Id: I11e0091482d9acee89ca018374cb8d96d22f8514
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20240125110122.16257-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28133.html
Signed-off-by: Gert Doering 
---
M forked-test-driver
1 file changed, 7 insertions(+), 2 deletions(-)




diff --git a/forked-test-driver b/forked-test-driver
index be73b80..6971dfb 100755
--- a/forked-test-driver
+++ b/forked-test-driver
@@ -108,9 +108,14 @@
 # Test script is run here. We create the file first, then append to it,
 # to ameliorate tests themselves also writing to the log file. Our tests
 # don't, but others can (automake bug#35762).
+# OVPN changes:
+#  - add tee to see output of tests
+#  - needs portable pipefail mechanism
+estatusfile="${trs_file}.exit"
 : >"$log_file"
-"$@" >>"$log_file" 2>&1
-estatus=$?
+("$@" 2>&1; estatus=$?; echo $estatus >"$estatusfile") | tee -a "$log_file"
+estatus=$(cat "$estatusfile")
+rm -f "$estatusfile"

 if test $enable_hard_errors = no && test $estatus -eq 99; then
   tweaked_estatus=1

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/479?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I11e0091482d9acee89ca018374cb8d96d22f8514
Gerrit-Change-Number: 479
Gerrit-PatchSet: 12
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: tests: fork default automake test-driver

2024-04-03 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#11) to the change originally created by 
flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/478?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos


Change subject: tests: fork default automake test-driver
..

tests: fork default automake test-driver

For some of the test we don't like the default log behavior
and there seems no easy way to change that except to fork
the driver. The license seems unproblematic since we're
GPL anyway.

v2:
 - Do not use forked-test-driver for UTs. Default behavior
   is fine for those.

Change-Id: I67d461afbcc9c06b1fc5ab4477141d7b8bd9ba8e
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20240125110036.16070-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28132.html
Signed-off-by: Gert Doering 
---
M Makefile.am
A forked-test-driver
M tests/Makefile.am
3 files changed, 156 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/478/11

diff --git a/Makefile.am b/Makefile.am
index 439346e..87230fe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,7 +45,8 @@
ltrc.inc \
CMakeLists.txt \
CMakePresets.json \
-   config.h.cmake.in
+   config.h.cmake.in \
+   forked-test-driver

 .PHONY: config-version.h doxygen

diff --git a/forked-test-driver b/forked-test-driver
new file mode 100755
index 000..be73b80
--- /dev/null
+++ b/forked-test-driver
@@ -0,0 +1,153 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to  or send patches to
+# .
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <"$log_file"
+"$@" >>"$log_file" 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2885752..5e9ad0a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,7 @@
 SUBDIRS = unit_tests

 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) System Tests'
+LOG_DRIVER = $(SHELL) $(top_srcdir)/forked-test-driver

 if !WIN32
 test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/478?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master

[Openvpn-devel] [XS] Change in openvpn[master]: forked-test-driver: Show test output always

2024-04-03 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#12) to the change originally created by 
flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/479?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos


Change subject: forked-test-driver: Show test output always
..

forked-test-driver: Show test output always

We want to see the progress, at least for slow tests
like t_client.sh.

Change-Id: I11e0091482d9acee89ca018374cb8d96d22f8514
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20240125110122.16257-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28133.html
Signed-off-by: Gert Doering 
---
M forked-test-driver
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/79/479/12

diff --git a/forked-test-driver b/forked-test-driver
index be73b80..6971dfb 100755
--- a/forked-test-driver
+++ b/forked-test-driver
@@ -108,9 +108,14 @@
 # Test script is run here. We create the file first, then append to it,
 # to ameliorate tests themselves also writing to the log file. Our tests
 # don't, but others can (automake bug#35762).
+# OVPN changes:
+#  - add tee to see output of tests
+#  - needs portable pipefail mechanism
+estatusfile="${trs_file}.exit"
 : >"$log_file"
-"$@" >>"$log_file" 2>&1
-estatus=$?
+("$@" 2>&1; estatus=$?; echo $estatus >"$estatusfile") | tee -a "$log_file"
+estatus=$(cat "$estatusfile")
+rm -f "$estatusfile"

 if test $enable_hard_errors = no && test $estatus -eq 99; then
   tweaked_estatus=1

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/479?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I11e0091482d9acee89ca018374cb8d96d22f8514
Gerrit-Change-Number: 479
Gerrit-PatchSet: 12
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: forked-test-driver: Show test output always

2024-04-03 Thread Gert Doering
Tested this in various build environments, including Ubuntu/MinGW,
and GHA, and things still work & test "as before".  Combined with the
previous commit, we get useful (for me) "I can see what make check is doing
all the time" behaviour back.

I'm still not convinced that this is a better way forward than just
using the old test-driver and possibly tweaking Makefiles a bit, but
"this does work for me", and automake upstream seems to think it's the
way to go...  thanks, Frank, for doing the actual work :-)

Your patch has been applied to the master branch.

commit e2ff9161e1b1b3e8c83bf01e3c488e0601834c0c
Author: Frank Lichtenheld
Date:   Thu Jan 25 12:01:22 2024 +0100

 forked-test-driver: Show test output always

 Signed-off-by: Frank Lichtenheld 
 Acked-by: Arne Schwabe 
 Message-Id: <20240125110122.16257-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28133.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: tests: fork default automake test-driver

2024-04-03 Thread Gert Doering
Tested this in various build environments, including Ubuntu/MinGW,
and GHA, and things still work & test "as before".  Combined with the
next commit, we get useful (for me) "I can see what make check is doing
all the time" behaviour back.

Your patch has been applied to the master branch.

commit aea6e9aa854b454f98671382eb751662dd9e1e03
Author: Frank Lichtenheld
Date:   Thu Jan 25 12:00:36 2024 +0100

 tests: fork default automake test-driver

 Signed-off-by: Frank Lichtenheld 
 Acked-by: Arne Schwabe 
 Message-Id: <20240125110036.16070-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28132.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel