trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 9.0.x updated: Fix uri_signing unit test for out of source builds (#8040)
Date Tue, 13 Jul 2021 20:26:07 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 8899b9f  Fix uri_signing unit test for out of source builds (#8040)
8899b9f is described below

commit 8899b9f45e8b9b147aa44fe36d34038645d981c0
Author: Brian Neradt <brian.neradt@gmail.com>
AuthorDate: Tue Jul 6 14:27:07 2021 -0500

    Fix uri_signing unit test for out of source builds (#8040)
    
    The URI signing plugin unit test accesses a config file in the source
    directory. This works fine for in-source builds, but did not for out of
    source. This updates the Makefile and unit test so that the file is
    accessible for out of source builds.
    
    (cherry picked from commit 8fb685b0815e42c6364c127f0c8e069013c2db0b)
---
 configure.ac                                                    | 2 +-
 plugins/experimental/uri_signing/Makefile.inc                   | 7 ++++++-
 plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc | 4 ++--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index e4c892a..a5fa881 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1414,7 +1414,7 @@ TS_CHECK_BROTLI
 TS_CHECK_LUAJIT
 
 #
-# Enable experimental/uri_singing plugin
+# Enable experimental/uri_signing plugin
 # This is here, instead of above, because it needs to know if PCRE is available.
 #
 
diff --git a/plugins/experimental/uri_signing/Makefile.inc b/plugins/experimental/uri_signing/Makefile.inc
index 7632c49..fd2eae3 100644
--- a/plugins/experimental/uri_signing/Makefile.inc
+++ b/plugins/experimental/uri_signing/Makefile.inc
@@ -30,7 +30,12 @@ experimental_uri_signing_uri_signing_la_LIBADD = @LIBJANSSON@ @LIBCJOSE@
@LIBPCR
 
 check_PROGRAMS += experimental/uri_signing/test_uri_signing
 
-experimental_uri_signing_test_uri_signing_CPPFLAGS = $(AM_CPPFLAGS) -I$(abs_top_srcdir)/tests/include
-DURI_SIGNING_UNIT_TEST
+experimental_uri_signing_test_uri_signing_CPPFLAGS = \
+  $(AM_CPPFLAGS) \
+  -I$(abs_top_srcdir)/tests/include \
+  -DURI_SIGNING_UNIT_TEST \
+  -DSRCDIR=\"$(srcdir)\"
+
 experimental_uri_signing_test_uri_signing_LDADD = @LIBJANSSON@ @LIBCJOSE@ @LIBPCRE@ -lm -lcrypto
 experimental_uri_signing_test_uri_signing_SOURCES = \
 	experimental/uri_signing/unit_tests/uri_signing_test.cc \
diff --git a/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc b/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
index 20b2104..a34877b 100644
--- a/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
+++ b/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
@@ -571,7 +571,7 @@ TEST_CASE("7", "[TestsConfig]")
 
   SECTION("Config Loading ID Field")
   {
-    struct config *cfg = read_config("experimental/uri_signing/unit_tests/testConfig.config");
+    struct config *cfg = read_config(SRCDIR "/experimental/uri_signing/unit_tests/testConfig.config");
     REQUIRE(cfg != NULL);
     REQUIRE(strcmp(config_get_id(cfg), "tester") == 0);
     config_delete(cfg);
@@ -603,7 +603,7 @@ jws_validation_helper(const char *url, const char *package, struct config
*cfg)
 TEST_CASE("8", "[TestsWithConfig]")
 {
   INFO("TEST 8, Tests Involving Validation with Config");
-  struct config *cfg = read_config("experimental/uri_signing/unit_tests/testConfig.config");
+  struct config *cfg = read_config(SRCDIR "/experimental/uri_signing/unit_tests/testConfig.config");
 
   SECTION("Validation of Valid Aud String in JWS")
   {

Mime
View raw message