Skip to contentSkip to conversation

Change in openvpn[master]: openvpnserv: Add a first unit test

Openvpn-devel In review flichtenheld (Code Review) 2 participants 10 messages Jan 7 – Jan 24 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1767808679000.I33583e51e1143c53fbe0aef16546fa3f602b17c0@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email

to review the following change.

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

---
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

5 files changed, 172 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/1

src/openvpnserv/CMakeLists.txt +41 -0
index 2c8f310..67a89ef 100644
@@ -74,3 +74,44 @@
 endif()
 
 add_dependencies(openvpnserv msg_mc_gen)
+
+if (BUILD_TESTING)
+    set(unit_tests
+        "test_openvpnserv"
+    )
+
+    foreach (test_name ${unit_tests})
+        add_test(${test_name} ${test_name})
+        add_executable(${test_name}
+            ../../tests/unit_tests/openvpnserv/${test_name}.c
+            ${MC_GEN_DIR}/eventmsg.h
+        )
+
+        target_link_libraries(${test_name} PUBLIC ${CMOCKA_LIBRARIES})
+        target_include_directories(${test_name} PRIVATE
+            .
+            ../../include
+            ../openvpn
+            ${MC_GEN_DIR}
+            ../../tests/unit_tests/openvpn
+        )
+        target_compile_options(${test_name} PRIVATE
+            -D_UNICODE
+            -UNTDDI_VERSION
+            -D_WIN32_WINNT=_WIN32_WINNT_VISTA
+        )
+        target_link_libraries(${test_name} PRIVATE
+            advapi32.lib userenv.lib iphlpapi.lib fwpuclnt.lib rpcrt4.lib
+            shlwapi.lib netapi32.lib ws2_32.lib ntdll.lib ole32.lib pathcch.lib)
+        if (MINGW)
+            target_compile_options(${test_name} PRIVATE -municode)
+            target_link_options(${test_name} PRIVATE -municode)
+        endif ()
+    endforeach()
+
+    target_sources(test_openvpnserv PRIVATE
+        common.c
+        validate.c
+        ../openvpn/wfp_block.c ../openvpn/wfp_block.h
+    )
+endif ()
tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index 3a0598d..4153ca3 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +15 -0
new file mode 100644
index 0000000..5758cd4
@@ -0,0 +1,15 @@
+AUTOMAKE_OPTIONS = foreign
+
+EXTRA_DIST = input
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email

to look at the new patch set (#3).

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 173 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/3

configure.ac +1 -0
index 8ba5673..d3d548b 100644
@@ -1460,6 +1460,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +41 -0

44 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +15 -0
new file mode 100644
index 0000000..5758cd4
@@ -0,0 +1,15 @@
+AUTOMAKE_OPTIONS = foreign
+
+EXTRA_DIST = input
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email

to look at the new patch set (#5).

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 182 insertions(+), 20 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/5

configure.ac +1 -0
index 8ba5673..d3d548b 100644
@@ -1460,6 +1460,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +16 -0
new file mode 100644
index 0000000..6064978
@@ -0,0 +1,16 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email )

Change subject: openvpnserv: Add a first unit test
......................................................................

Patch Set 5: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 08 Jan 2026 17:33:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello cron2, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email

to look at the new patch set (#6).

The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 182 insertions(+), 20 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/6

configure.ac +1 -0
index 8ba5673..d3d548b 100644
@@ -1460,6 +1460,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +16 -0
new file mode 100644
index 0000000..6064978
@@ -0,0 +1,16 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#6 lore raw

PATCH v6 1/1 openvpnserv: Add a first unit test

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1459
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1459
This mail reflects revision 6 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

configure.ac +1 -0
index 8ba5673..d3d548b 100644
@@ -1460,6 +1460,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +16 -0
new file mode 100644
index 0000000..6064978
@@ -0,0 +1,16 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

#7 lore raw

[Openvpn-devel] [PATCH applied] Re: openvpnserv: Add a first unit test

This is most welcome... the function in question has so many edge cases it's really hard to "just review", and being able to systematically test is great (more tests could be necessary to cover everything :-) ).

The "mingw <-> autoconf <-> cmocka (cross-build)" interaction is not really perfect yet - if there is no cross-built cmocka, configure will not notice, and "make check" will just fail with

pkey_test_utils.c:32:10: fatal error: cmocka.h: No such file or directory

     32 | #include <cmocka.h>
        |          ^~~~~~~~~~

.. more work needed. But not not fault of this patch... so, tested with Github Actions, and that compiles all UTs fine. It does not yet *run* them, as far as I can see... so work on the build.yaml seems needed.

Your patch has been applied to the master branch.

commit b10ee38ccde5f155d02fcd3e8f1b1ab454826ab0

Author: Frank Lichtenheld
Date:   Mon Jan 19 22:50:53 2026 +0100
     openvpnserv: Add a first unit test

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1459
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg35345.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#8 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello cron2, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email

to look at the new patch set (#7).

The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 182 insertions(+), 20 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/7

configure.ac +1 -0
index 2d8de7c..841b0d1 100644
@@ -1431,6 +1431,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +16 -0
new file mode 100644
index 0000000..6064978
@@ -0,0 +1,16 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
+
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 7
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#9 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#8) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email )

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

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1459
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35345.html

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 181 insertions(+), 20 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1459/8

configure.ac +1 -0
index 2d8de7c..841b0d1 100644
@@ -1431,6 +1431,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +15 -0
new file mode 100644
index 0000000..6294c52
@@ -0,0 +1,15 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 8
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#10 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1459?usp=email )

Change subject: openvpnserv: Add a first unit test
......................................................................

openvpnserv: Add a first unit test

This adds the required build infrastructure
and adds tests for two functions related to
GetItfDnsDomains().

Change-Id I33583e51e1143c53fbe0aef16546fa3f602b17c0

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1459
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35345.html

---
M configure.ac
M src/openvpnserv/CMakeLists.txt
M tests/unit_tests/Makefile.am
M tests/unit_tests/openvpn/test_common.h
A tests/unit_tests/openvpnserv/Makefile.am
A tests/unit_tests/openvpnserv/test_openvpnserv.c

6 files changed, 181 insertions(+), 20 deletions(-)
configure.ac +1 -0
index 2d8de7c..841b0d1 100644
@@ -1431,6 +1431,7 @@
         tests/unit_tests/Makefile
         tests/unit_tests/example_test/Makefile
         tests/unit_tests/openvpn/Makefile
+        tests/unit_tests/openvpnserv/Makefile
         tests/unit_tests/plugins/Makefile
         tests/unit_tests/plugins/auth-pam/Makefile
 	sample/Makefile
src/openvpnserv/CMakeLists.txt +49 -18

83 lines not on this page · raw message

tests/unit_tests/Makefile.am +1 -1
index 33fefaa..ce6278e 100644
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
 
 if ENABLE_UNITTESTS
-SUBDIRS = example_test openvpn plugins
+SUBDIRS = example_test openvpn openvpnserv plugins
 endif
tests/unit_tests/openvpn/test_common.h +2 -1
index f898e89..156e5a9 100644
@@ -20,8 +20,9 @@
  *  with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
 #include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <cmocka.h>
 
 /* Do we use cmocka < 2.0.0? */
tests/unit_tests/openvpnserv/Makefile.am new file +15 -0
new file mode 100644
index 0000000..6294c52
@@ -0,0 +1,15 @@
+AUTOMAKE_OPTIONS = foreign
+
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) service Unit-Tests'
+
+if WIN32
+test_binaries = openvpnserv_testdriver
+endif
+
+openvpnserv_testdriver_CFLAGS  = -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpnserv @TEST_CFLAGS@
+openvpnserv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
+openvpnserv_testdriver_SOURCES = test_openvpnserv.c \
+	$(top_srcdir)/src/openvpnserv/common.c \
+	$(top_srcdir)/src/openvpnserv/validate.c \
+	$(top_srcdir)/src//openvpn/wfp_block.c \
+	$(top_srcdir)/src//openvpn/wfp_block.h
tests/unit_tests/openvpnserv/test_openvpnserv.c new file +113 -0

113 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1459?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: I33583e51e1143c53fbe0aef16546fa3f602b17c0
Gerrit-Change-Number: 1459
Gerrit-PatchSet: 8
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>