[Openvpn-devel] build: Package missing mock_msg.h

Message ID 20190417203015.1903-1-davids@openvpn.net
State Accepted
Headers show
Series
  • [Openvpn-devel] build: Package missing mock_msg.h
Related show

Commit Message

David Sommerseth April 17, 2019, 8:30 p.m.
The mock_msg.h file was not enlisted in the _SOURCES lists in
Makefile.am for the unit tests.  This caused the mock_msg.h file to not
be present in the .tar.gz file created by 'make dist'.

This was not noticed earlier as we haven't really tried much to run git
clone of the cmocka project manually in vendor/ from an unpacked
tarball.

With this fix the cmocka unit tests can also run from tarballs, with
manually extracting/fetching the cmocka source code in vendor/cmocka.

Signed-off-by: David Sommerseth <davids@openvpn.net>

----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

How to test:

- Create a tarball: make distcheck (or just 'dist')
- Extract openvpn-2.5_git.tar.gz in a clean directory
- cd openvpn-2.5_git/vendor
- git clone https://git.cryptomilk.org/projects/cmocka.git
- ./configure
- make check
- Observe that the cmocka unit tests ran as expected

Depending on the CMake version, you might want to check out cmocka git
commit b2732b52202ae48f; which is the one we use in the git submodule.
---
 tests/unit_tests/openvpn/Makefile.am | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Steffan Karger May 2, 2019, 1:29 p.m. | #1
On 17-04-19 22:30, David Sommerseth wrote:
> The mock_msg.h file was not enlisted in the _SOURCES lists in
> Makefile.am for the unit tests.  This caused the mock_msg.h file to not
> be present in the .tar.gz file created by 'make dist'.
> 
> This was not noticed earlier as we haven't really tried much to run git
> clone of the cmocka project manually in vendor/ from an unpacked
> tarball.
> 
> With this fix the cmocka unit tests can also run from tarballs, with
> manually extracting/fetching the cmocka source code in vendor/cmocka.
> 
> Signed-off-by: David Sommerseth <davids@openvpn.net>
> 
> ----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
> 
> How to test:
> 
> - Create a tarball: make distcheck (or just 'dist')
> - Extract openvpn-2.5_git.tar.gz in a clean directory
> - cd openvpn-2.5_git/vendor
> - git clone https://git.cryptomilk.org/projects/cmocka.git
> - ./configure
> - make check
> - Observe that the cmocka unit tests ran as expected
> 
> Depending on the CMake version, you might want to check out cmocka git
> commit b2732b52202ae48f; which is the one we use in the git submodule.
> ---
>  tests/unit_tests/openvpn/Makefile.am | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am
> index 4f137b2b..657957e5 100644
> --- a/tests/unit_tests/openvpn/Makefile.am
> +++ b/tests/unit_tests/openvpn/Makefile.am
> @@ -19,7 +19,7 @@ compat_srcdir = $(top_srcdir)/src/compat
>  
>  argv_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir)
>  argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line
> -argv_testdriver_SOURCES = test_argv.c mock_msg.c \
> +argv_testdriver_SOURCES = test_argv.c mock_msg.c mock_msg.h \
>  	mock_get_random.c \
>  	$(openvpn_srcdir)/platform.c \
>  	$(openvpn_srcdir)/buffer.c \
> @@ -27,14 +27,14 @@ argv_testdriver_SOURCES = test_argv.c mock_msg.c \
>  
>  buffer_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir)
>  buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line
> -buffer_testdriver_SOURCES = test_buffer.c mock_msg.c \
> +buffer_testdriver_SOURCES = test_buffer.c mock_msg.c mock_msg.h \
>  	mock_get_random.c \
>  	$(openvpn_srcdir)/platform.c
>  
>  crypto_testdriver_CFLAGS  = @TEST_CFLAGS@ \
>  	-I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
>  crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@
> -crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
> +crypto_testdriver_SOURCES = test_crypto.c mock_msg.c mock_msg.h \
>  	$(openvpn_srcdir)/buffer.c \
>  	$(openvpn_srcdir)/crypto.c \
>  	$(openvpn_srcdir)/crypto_mbedtls.c \
> @@ -46,7 +46,7 @@ crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
>  packet_id_testdriver_CFLAGS  = @TEST_CFLAGS@ \
>  	-I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
>  packet_id_testdriver_LDFLAGS = @TEST_LDFLAGS@
> -packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c \
> +packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c mock_msg.h \
>  	mock_get_random.c \
>  	$(openvpn_srcdir)/buffer.c \
>  	$(openvpn_srcdir)/otime.c \
> @@ -60,7 +60,7 @@ tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
>  	-Wl,--wrap=buffer_write_file \
>  	-Wl,--wrap=parse_line \
>  	-Wl,--wrap=rand_bytes
> -tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c \
> +tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
>  	$(openvpn_srcdir)/argv.c \
>  	$(openvpn_srcdir)/base64.c \
>  	$(openvpn_srcdir)/buffer.c \
> 

Makes sense. Apologies for the omission.

Acked-by: Steffan Karger <steffan.karger@foxcrypto.com>

-Steffan
Gert Doering May 3, 2019, 6:42 p.m. | #2
Your patch has been applied to the master branch.

I think the functionality makes sense in 2.4 as well (we do have a
mock-msg.h there as well) but the patch resists application...

commit 19a22ac5a8673e87157a516b936ce008bacb44ea
Author: David Sommerseth
Date:   Wed Apr 17 22:30:15 2019 +0200

     build: Package missing mock_msg.h

     Signed-off-by: David Sommerseth <davids@openvpn.net>
     Acked-by: Steffan Karger <steffan.karger@fox-it.com>
     Message-Id: <20190417203015.1903-1-davids@openvpn.net>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18380.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am
index 4f137b2b..657957e5 100644
--- a/tests/unit_tests/openvpn/Makefile.am
+++ b/tests/unit_tests/openvpn/Makefile.am
@@ -19,7 +19,7 @@  compat_srcdir = $(top_srcdir)/src/compat
 
 argv_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir)
 argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line
-argv_testdriver_SOURCES = test_argv.c mock_msg.c \
+argv_testdriver_SOURCES = test_argv.c mock_msg.c mock_msg.h \
 	mock_get_random.c \
 	$(openvpn_srcdir)/platform.c \
 	$(openvpn_srcdir)/buffer.c \
@@ -27,14 +27,14 @@  argv_testdriver_SOURCES = test_argv.c mock_msg.c \
 
 buffer_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir)
 buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line
-buffer_testdriver_SOURCES = test_buffer.c mock_msg.c \
+buffer_testdriver_SOURCES = test_buffer.c mock_msg.c mock_msg.h \
 	mock_get_random.c \
 	$(openvpn_srcdir)/platform.c
 
 crypto_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
 crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@
-crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
+crypto_testdriver_SOURCES = test_crypto.c mock_msg.c mock_msg.h \
 	$(openvpn_srcdir)/buffer.c \
 	$(openvpn_srcdir)/crypto.c \
 	$(openvpn_srcdir)/crypto_mbedtls.c \
@@ -46,7 +46,7 @@  crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
 packet_id_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
 packet_id_testdriver_LDFLAGS = @TEST_LDFLAGS@
-packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c \
+packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c mock_msg.h \
 	mock_get_random.c \
 	$(openvpn_srcdir)/buffer.c \
 	$(openvpn_srcdir)/otime.c \
@@ -60,7 +60,7 @@  tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
 	-Wl,--wrap=buffer_write_file \
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
-tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c \
+tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
 	$(openvpn_srcdir)/argv.c \
 	$(openvpn_srcdir)/base64.c \
 	$(openvpn_srcdir)/buffer.c \