tests: Fix for missing qa-connlabel.conf in tarball
Phil Sutter
reviewerPATCH 1/2 tests: Fix for missing qa-connlabel.conf in tarball
Register the file as extra dist so 'make dist' picks it up.
Fixes 6510a98f4139f ("api: add connlabel api and attribute")
Signed-off-by Phil Sutter <[email protected]>
--- tests/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
tests/Makefile.am +2 -0
@@ -3,6 +3,8 @@ include $(top_srcdir)/Make_global.am check_PROGRAMS = test_api test_filter test_connlabel ct_stress \ ct_events_reliable +EXTRA_DIST = qa-connlabel.conf + test_api_SOURCES = test_api.c test_api_LDADD = ../src/libnetfilter_conntrack.la
Signature · 1 line
2.34.1
Phil Sutter
reviewerPATCH 2/2 tests: Add simple tests to TESTS variable
This way, 'make check' and 'make distcheck' call them. Omit ct_stress/ct_events_reliable, they require root.
For test_connlabel to find qa-connlabel.conf during 'make distcheck', use of 'srcdir' env variable is needed. Add this as a third option to not break existing use-cases.
Signed-off-by Phil Sutter <[email protected]>
--- tests/Makefile.am | 2 ++ tests/test_connlabel.c | 8 ++++++++ 2 files changed, 10 insertions(+)
tests/Makefile.am +2 -0
@@ -5,6 +5,8 @@ check_PROGRAMS = test_api test_filter test_connlabel ct_stress \ EXTRA_DIST = qa-connlabel.conf +TESTS = test_api test_filter test_connlabel + test_api_SOURCES = test_api.c test_api_LDADD = ../src/libnetfilter_conntrack.la
tests/test_connlabel.c +8 -0
@@ -1,4 +1,5 @@#include <assert.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <time.h>
@@ -60,6 +61,13 @@ int main(void) l =nfct_labelmap_new ("qa-connlabel.conf" );if (!l) l =nfct_labelmap_new ("tests/qa-connlabel.conf" ); +if (!l) { +char testconf[PATH_MAX ]; + +snprintf (testconf,PATH_MAX , +"%s/qa-connlabel.conf" ,getenv ("srcdir" )); + l =nfct_labelmap_new (testconf); + }assert (l);puts ("qa-connlabel.conf:" );dump_map (l);
Signature · 1 line
2.34.1
Pablo Neira Ayuso
maintainerSeries LGTM. Thanks
Quoted 24 lines · Phil Sutter
Register the file as extra dist so 'make dist' picks it up.
Fixes 6510a98f4139f ("api: add connlabel api and attribute")Signed-off-by Phil Sutter <[email protected]>--- tests/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)tests/Makefile.am +2
-0@@ -3,6 +3,8 @@ include $(top_srcdir)/Make_global.am check_PROGRAMS = test_api test_filter test_connlabel ct_stress \ ct_events_reliable +EXTRA_DIST = qa-connlabel.conf + test_api_SOURCES = test_api.c test_api_LDADD = ../src/libnetfilter_conntrack.laSignature · 1 line
2.34.1