From d1d4aefec68abb1239a60f48fb2a0f86553df78c Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 30 May 2022 19:02:18 +0300 Subject: [PATCH 01/14] [#2071] propagate all flags from configure to distcheck --- Makefile.am | 27 ++++++++++++++++--- configure.ac | 8 ++++++ doc/sphinx/Makefile.am | 1 - doc/sphinx/arm/dhcp4-srv.rst | 2 +- m4macros/ax_gssapi.m4 | 2 ++ m4macros/ax_sysrepo.m4 | 6 +++++ src/bin/admin/tests/data/Makefile.am | 4 +-- src/bin/agent/tests/Makefile.am | 2 +- src/bin/d2/tests/Makefile.am | 2 +- src/bin/dhcp4/tests/Makefile.am | 2 +- src/bin/dhcp6/tests/Makefile.am | 2 +- src/bin/keactrl/Makefile.am | 22 ++++++++------- src/bin/lfc/tests/Makefile.am | 2 +- src/bin/netconf/tests/Makefile.am | 2 +- src/bin/perfdhcp/tests/Makefile.am | 2 +- src/lib/dhcpsrv/tests/Makefile.am | 2 +- .../dhcpsrv/tests/mysql_lease_mgr_unittest.cc | 20 ++++++++++++++ .../mysql_generic_backend_unittest.cc | 3 +++ .../pgsql_generic_backend_unittest.cc | 3 +++ src/lib/hooks/tests/Makefile.am | 5 ++-- src/lib/log/interprocess/tests/Makefile.am | 2 +- src/lib/util/tests/Makefile.am | 2 +- 22 files changed, 94 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index ebcf3e7fbe..18b34e7eb4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,11 @@ DISTCHECK_PERFDHCP_CONFIGURE_FLAG=@DISTCHECK_PERFDHCP_CONFIGURE_FLAG@ DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@ DISTCHECK_PREMIUM_CONFIGURE_FLAG=@DISTCHECK_PREMIUM_CONFIGURE_FLAG@ DISTCHECK_CONTRIB_CONFIGURE_FLAG=@DISTCHECK_CONTRIB_CONFIGURE_FLAG@ +DISTCHECK_MYSQL_CONFIGURE_FLAG=@DISTCHECK_MYSQL_CONFIGURE_FLAG@ +DISTCHECK_PGSQL_CONFIGURE_FLAG=@DISTCHECK_PGSQL_CONFIGURE_FLAG@ +DISTCHECK_GSSAPI_CONFIGURE_FLAG=@DISTCHECK_GSSAPI_CONFIGURE_FLAG@ +DISTCHECK_LIBYANG_CONFIGURE_FLAG=@DISTCHECK_LIBYANG_CONFIGURE_FLAG@ +DISTCHECK_SYSREPO_CONFIGURE_FLAG=@DISTCHECK_SYSREPO_CONFIGURE_FLAG@ OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html @@ -47,6 +52,21 @@ DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PREMIUM_CONFIGURE_FLAG) # Keep the contrib config DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CONTRIB_CONFIGURE_FLAG) +# Keep the mysql config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_MYSQL_CONFIGURE_FLAG) + +# Keep the pgsql config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PGSQL_CONFIGURE_FLAG) + +# Keep the gssapi config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GSSAPI_CONFIGURE_FLAG) + +# Keep the libyang config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LIBYANG_CONFIGURE_FLAG) + +# Keep the sysrepo config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_SYSREPO_CONFIGURE_FLAG) + dist_doc_DATA = AUTHORS COPYING ChangeLog README CONTRIBUTING.md platforms.rst code_of_conduct.md .PHONY: check-valgrind check-valgrind-suppress @@ -114,9 +134,10 @@ endif --ignore-errors gcov,source,graph \ --output report.info; \ sed --in-place --expression "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" report.info; \ - "$(GENHTML)" --frames --show-details --title 'Kea code coverage report' --legend \ - --function-coverage --ignore-errors source --demangle-cpp \ - --output "$(OVERALL_COVERAGE_DIR)" report.info; \ + "$(GENHTML)" \ + --frames --show-details --title 'Kea code coverage report' --legend \ + --function-coverage --ignore-errors source --demangle-cpp \ + --output "$(OVERALL_COVERAGE_DIR)" report.info; \ printf "Generated C++ code coverage report in HTML at %s.\n" "$(OVERALL_COVERAGE_DIR)"; \ else \ echo "C++ code coverage not enabled at configuration time." ; \ diff --git a/configure.ac b/configure.ac index 7e02660125..d8605f6378 100644 --- a/configure.ac +++ b/configure.ac @@ -677,11 +677,14 @@ elif test "${mysql_config}" != "no" ; then MYSQL_CONFIG="${withval}" fi +DISTCHECK_MYSQL_CONFIGURE_FLAG= if test "$MYSQL_CONFIG" != "" ; then if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then AC_MSG_ERROR([MySQL dependencies cannot be found. Please install MySQL libraries or point --with-mysql to mysql_config program if it is located in non-default directory, eg. --with-mysql=/opt/mysql/bin/mysql_config.]) fi + DISTCHECK_MYSQL_CONFIGURE_FLAG="--with-mysql=$MYSQL_CONFIG" + MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags` MYSQL_LIBS=`$MYSQL_CONFIG --libs` MYSQL_LIBS="$MYSQL_LIBS $CRYPTO_LIBS" @@ -689,6 +692,7 @@ if test "$MYSQL_CONFIG" != "" ; then AC_SUBST(MYSQL_CPPFLAGS) AC_SUBST(MYSQL_LIBS) + AC_SUBST(DISTCHECK_MYSQL_CONFIGURE_FLAG) # Check that a simple program using MySQL functions can compile and link. CPPFLAGS_SAVED="$CPPFLAGS" @@ -757,11 +761,14 @@ elif test "${pg_config}" != "no" ; then PG_CONFIG="${withval}" fi +DISTCHECK_PGSQL_CONFIGURE_FLAG= if test "$PG_CONFIG" != "" ; then if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then AC_MSG_ERROR([PostgreSQL dependencies cannot be found. Please install PostgreSQL libraries or point --with-pgsql to pg_config program if it is located in non-default directory, eg. --with-pgsql=/opt/pgsql/bin/pg_config.]) fi + DISTCHECK_PGSQL_CONFIGURE_FLAG="--with-pgsql=$PG_CONFIG" + PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags` PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir` PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server` @@ -772,6 +779,7 @@ if test "$PG_CONFIG" != "" ; then AC_SUBST(PGSQL_CPPFLAGS) AC_SUBST(PGSQL_LIBS) + AC_SUBST(DISTCHECK_PGSQL_CONFIGURE_FLAG) # Check that a simple program using PostgreSQL functions can compile and link. CPPFLAGS_SAVED="$CPPFLAGS" diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am index 7fa957bdcd..bfe15ea002 100644 --- a/doc/sphinx/Makefile.am +++ b/doc/sphinx/Makefile.am @@ -188,7 +188,6 @@ update-python-dependencies: ./src/requirements.in clean-local: rm -rf $(sphinxbuilddir) - rm -f $(srcdir)/mes-files.txt $(srcdir)/api-files.txt rm -f $(srcdir)/kea-messages.rst $(srcdir)/api.rst rm -f $(srcdir)/arm/platforms.rst diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 534c18e4f7..3325893a62 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -6906,7 +6906,7 @@ All supported parameters can be configured via the ``cb_cmds`` hook library described in the :ref:`hooks-cb-cmds` section. The general rule is that scalar global parameters are set using ``remote-global-parameter4-set``; shared-network-specific parameters -are set using ``remote-network4-set``; and subnet- and pool-level +are set using ``remote-network4-set``; and subnet-level and pool-level parameters are set using ``remote-subnet4-set``. Whenever there is an exception to this general rule, it is highlighted in the table. Non-scalar global parameters have dedicated commands; for example, diff --git a/m4macros/ax_gssapi.m4 b/m4macros/ax_gssapi.m4 index 2360a3755e..539343edad 100644 --- a/m4macros/ax_gssapi.m4 +++ b/m4macros/ax_gssapi.m4 @@ -13,6 +13,7 @@ AC_ARG_WITH([gssapi], ENABLE_GSSAPI=no GSSAPI_CFLAGS= GSSAPI_LIBS= +DISTCHECK_GSSAPI_CONFIGURE_FLAG="--with-gssapi=$gssapi_path" AC_MSG_CHECKING([for gssapi support]) if test "x$gssapi_path" = "x" ; then @@ -86,6 +87,7 @@ fi AC_SUBST(GSSAPI_CFLAGS) AC_SUBST(GSSAPI_LIBS) +AC_SUBST(DISTCHECK_GSSAPI_CONFIGURE_FLAG) AM_CONDITIONAL([HAVE_GSSAPI], [test $ENABLE_GSSAPI = "yes"]) ])dnl AX_GSS_API diff --git a/m4macros/ax_sysrepo.m4 b/m4macros/ax_sysrepo.m4 index 415125e6b2..50b30713c1 100644 --- a/m4macros/ax_sysrepo.m4 +++ b/m4macros/ax_sysrepo.m4 @@ -4,10 +4,14 @@ AC_DEFUN([AX_SYSREPO], [ [AS_HELP_STRING([--with-libyang[[=PATH]]], [optional path to the libyang installation directory])], [with_libyang="${withval}"]) + DISTCHECK_LIBYANG_CONFIGURE_FLAG="--with-libyang=$with_libyang" + AC_ARG_WITH([sysrepo], [AS_HELP_STRING([--with-sysrepo[[=PATH]]], [optional path to the sysrepo installation directory])], [with_sysrepo="${withval}"]) + DISTCHECK_SYSREPO_CONFIGURE_FLAG="--with-sysrepo=$with_sysrepo" + # If --with-libyang was omitted, assume it was passed and give it the value # from --with-sysrepo. if test -z "${with_libyang}"; then @@ -220,4 +224,6 @@ AC_DEFUN([AX_SYSREPO], [ AC_SUBST(SRPD_PLUGINS_PATH) AC_SUBST(SYSREPO_VERSION) AC_SUBST(SYSREPOCPP_VERSION) + AC_SUBST(DISTCHECK_LIBYANG_CONFIGURE_FLAG) + AC_SUBST(DISTCHECK_SYSREPO_CONFIGURE_FLAG) ]) diff --git a/src/bin/admin/tests/data/Makefile.am b/src/bin/admin/tests/data/Makefile.am index 3e9f88dbbb..7ce62898ec 100644 --- a/src/bin/admin/tests/data/Makefile.am +++ b/src/bin/admin/tests/data/Makefile.am @@ -1,3 +1,3 @@ EXTRA_DIST = \ - lease4_dump_test.reference.csv \ - lease6_dump_test.reference.csv + lease4_dump_test.reference.csv \ + lease6_dump_test.reference.csv diff --git a/src/bin/agent/tests/Makefile.am b/src/bin/agent/tests/Makefile.am index 7cfedfeb11..40ac32765c 100644 --- a/src/bin/agent/tests/Makefile.am +++ b/src/bin/agent/tests/Makefile.am @@ -7,7 +7,7 @@ EXTRA_DIST += testdata/hiddens EXTRA_DIST += testdata/hiddenu TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = ca_process_tests.sh diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am index 0da992b6ec..b47513278e 100644 --- a/src/bin/d2/tests/Makefile.am +++ b/src/bin/d2/tests/Makefile.am @@ -6,7 +6,7 @@ EXTRA_DIST += testdata/d2_cfg_tests.json EXTRA_DIST += testdata/get_config.json TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = d2_process_tests.sh diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am index 8e5808bee5..291d29f284 100644 --- a/src/bin/dhcp4/tests/Makefile.am +++ b/src/bin/dhcp4/tests/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = . EXTRA_DIST = get_config_unittest.cc.skel TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp4_process_tests.sh diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index e3518f1ad4..78c7166312 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = . EXTRA_DIST = get_config_unittest.cc.skel TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp6_process_tests.sh diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am index e85392d056..ca9f255726 100644 --- a/src/bin/keactrl/Makefile.am +++ b/src/bin/keactrl/Makefile.am @@ -3,8 +3,9 @@ SUBDIRS = . tests # Install keactrl in sbin and the keactrl.conf required by the keactrl # in etc. keactrl will look for its configuration file in the etc folder. sbin_SCRIPTS = keactrl -KEA_CONFIGFILES = kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf \ - kea-ctrl-agent.conf +KEA_CONFIGFILES = \ + kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf kea-ctrl-agent.conf + if HAVE_SYSREPO KEA_CONFIGFILES += kea-netconf.conf endif @@ -13,9 +14,10 @@ CONFIGFILES = keactrl.conf $(KEA_CONFIGFILES) DISTCLEANFILES = keactrl keactrl.conf CLEANFILES = $(KEA_CONFIGFILES) -EXTRA_DIST = keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \ - kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \ - kea-ctrl-agent.conf.pre kea-netconf.conf.pre +EXTRA_DIST = \ + keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \ + kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \ + kea-ctrl-agent.conf.pre kea-netconf.conf.pre # *.conf files are not really sources used for building other targets, but we need # these files to be generated before make install is called. @@ -24,23 +26,23 @@ BUILT_SOURCES = $(KEA_CONFIGFILES) kea-dhcp4.conf: kea-dhcp4.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@ kea-dhcp6.conf: kea-dhcp6.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@ kea-dhcp-ddns.conf: kea-dhcp-ddns.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@ kea-ctrl-agent.conf: kea-ctrl-agent.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@ kea-netconf.conf: kea-netconf.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@ if INSTALL_CONFIGURATIONS diff --git a/src/bin/lfc/tests/Makefile.am b/src/bin/lfc/tests/Makefile.am index 65593436c0..edba11847d 100644 --- a/src/bin/lfc/tests/Makefile.am +++ b/src/bin/lfc/tests/Makefile.am @@ -15,7 +15,7 @@ AM_LDFLAGS = -static endif TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/netconf/tests/Makefile.am b/src/bin/netconf/tests/Makefile.am index e25e62a3b7..594472579f 100644 --- a/src/bin/netconf/tests/Makefile.am +++ b/src/bin/netconf/tests/Makefile.am @@ -24,7 +24,7 @@ AM_LDFLAGS = -static endif TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/perfdhcp/tests/Makefile.am b/src/bin/perfdhcp/tests/Makefile.am index 72202a8c4f..c62bd70b1f 100644 --- a/src/bin/perfdhcp/tests/Makefile.am +++ b/src/bin/perfdhcp/tests/Makefile.am @@ -17,7 +17,7 @@ CLEANFILES = *.gcno *.gcda CLEANFILES += test1.hex test2.hex test3.hex test4.hex test5.hex TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am index 804a497a73..8252ebad23 100644 --- a/src/lib/dhcpsrv/tests/Makefile.am +++ b/src/lib/dhcpsrv/tests/Makefile.am @@ -17,7 +17,7 @@ CLEANFILES = *.gcno *.gcda DISTCLEANFILES = test_libraries.h TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc index 9383db8b63..0b4f839abf 100644 --- a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1073,6 +1074,25 @@ TEST_F(MySqlLeaseMgrTest, leaseStatsQueryAttribution6MultiThreading) { testLeaseStatsQueryAttribution6(); } +/// @brief This test is a basic check for the generic backend test class, +/// rather than any production code check. +TEST_F(MySqlGenericBackendTest, leaseCount) { + + // Create database connection parameter list + DatabaseConnection::ParameterMap params; + params["name"] = "keatest"; + params["user"] = "keatest"; + params["password"] = "keatest"; + + // Create and open the database connection + MySqlConnection conn(params); + conn.openDatabase(); + + // Check that the countRows is working. It's used extensively in other + // tests, so basic check is enough here. + EXPECT_EQ(0, countRows(conn, "lease4")); +} + /// @brief Checks that no exceptions are thrown when inquiring about JSON /// support and prints an informative message. TEST_F(MySqlLeaseMgrTest, isJsonSupported) { diff --git a/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc b/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc index ace663e7b7..ac142d0c6f 100644 --- a/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc +++ b/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc @@ -6,8 +6,10 @@ #include #include +#include using namespace isc::db; +using namespace isc::db::test; namespace isc { namespace dhcp { @@ -15,6 +17,7 @@ namespace test { MySqlGenericBackendTest::MySqlGenericBackendTest() : GenericBackendTest() { + createMySQLSchema(); } size_t diff --git a/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc b/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc index 412ff0486e..8d588a1049 100644 --- a/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc +++ b/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc @@ -6,8 +6,10 @@ #include #include +#include using namespace isc::db; +using namespace isc::db::test; namespace isc { namespace dhcp { @@ -15,6 +17,7 @@ namespace test { PgSqlGenericBackendTest::PgSqlGenericBackendTest() : GenericBackendTest() { + createPgSQLSchema(); } size_t diff --git a/src/lib/hooks/tests/Makefile.am b/src/lib/hooks/tests/Makefile.am index b6fe8b9a8f..c9ea1a1ba1 100644 --- a/src/lib/hooks/tests/Makefile.am +++ b/src/lib/hooks/tests/Makefile.am @@ -38,8 +38,9 @@ if HAVE_GTEST # to unexpected errors. For this reason, the --enable-static-link option is # ignored for unit tests built here. -noinst_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \ - liblecl.la libucl.la libfcl.la libpcl.la libacl.la +noinst_LTLIBRARIES = \ + libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \ + liblecl.la libucl.la libfcl.la libpcl.la libacl.la # -rpath /nowhere is a hack to trigger libtool to not create a # convenience archive, resulting in shared modules diff --git a/src/lib/log/interprocess/tests/Makefile.am b/src/lib/log/interprocess/tests/Makefile.am index 5a53327338..a1f8a73113 100644 --- a/src/lib/log/interprocess/tests/Makefile.am +++ b/src/lib/log/interprocess/tests/Makefile.am @@ -15,7 +15,7 @@ endif CLEANFILES = *.gcno *.gcda TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/util/tests/Makefile.am b/src/lib/util/tests/Makefile.am index 56aff6a664..fd696504d6 100644 --- a/src/lib/util/tests/Makefile.am +++ b/src/lib/util/tests/Makefile.am @@ -18,7 +18,7 @@ CLEANFILES = *.gcno *.gcda CLEANFILES += *.csv TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST -- GitLab From b6e232752796e424bf57868833c4e548858b54cf Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 2 Jun 2022 17:19:57 +0300 Subject: [PATCH 02/14] [#2071] fixed paths for distcheck to work --- src/bin/admin/kea-admin.in | 52 ++++++++++--- src/bin/admin/tests/mysql_tests.sh.in | 74 ++++++++++++++----- src/bin/admin/tests/pgsql_tests.sh.in | 65 +++++++++++++--- .../mysql/upgrade_001.0_to_002.0.sh.in | 4 +- .../mysql/upgrade_002.0_to_003.0.sh.in | 4 +- .../mysql/upgrade_003.0_to_004.0.sh.in | 4 +- .../mysql/upgrade_004.0_to_004.1.sh.in | 4 +- .../mysql/upgrade_004.1_to_005.0.sh.in | 4 +- .../mysql/upgrade_005.0_to_005.1.sh.in | 4 +- .../mysql/upgrade_005.1_to_005.2.sh.in | 4 +- .../mysql/upgrade_005.2_to_006.0.sh.in | 4 +- .../mysql/upgrade_006.0_to_007.0.sh.in | 4 +- .../mysql/upgrade_007.0_to_008.0.sh.in | 4 +- .../mysql/upgrade_008.0_to_008.1.sh.in | 4 +- .../mysql/upgrade_008.1_to_008.2.sh.in | 4 +- .../mysql/upgrade_008.2_to_009.0.sh.in | 4 +- .../mysql/upgrade_009.0_to_009.1.sh.in | 4 +- .../mysql/upgrade_009.1_to_009.2.sh.in | 4 +- .../mysql/upgrade_009.2_to_009.3.sh.in | 4 +- .../mysql/upgrade_009.3_to_009.4.sh.in | 4 +- .../mysql/upgrade_009.4_to_009.5.sh.in | 4 +- .../mysql/upgrade_009.5_to_009.6.sh.in | 4 +- .../mysql/upgrade_009.6_to_010.0.sh.in | 4 +- .../scripts/mysql/upgrade_010_to_011.sh.in | 4 +- .../scripts/mysql/upgrade_011_to_012.sh.in | 4 +- .../scripts/mysql/upgrade_012_to_013.sh.in | 4 +- .../database/scripts/mysql/wipe_data.sh.in | 4 +- .../pgsql/upgrade_001.0_to_002.0.sh.in | 4 +- .../pgsql/upgrade_002.0_to_003.0.sh.in | 4 +- .../pgsql/upgrade_003.0_to_003.1.sh.in | 4 +- .../pgsql/upgrade_003.1_to_003.2.sh.in | 4 +- .../pgsql/upgrade_003.2_to_003.3.sh.in | 4 +- .../pgsql/upgrade_003.3_to_004.0.sh.in | 4 +- .../pgsql/upgrade_004.0_to_005.0.sh.in | 4 +- .../pgsql/upgrade_005.0_to_005.1.sh.in | 4 +- .../pgsql/upgrade_005.1_to_006.0.sh.in | 4 +- .../pgsql/upgrade_006.0_to_006.1.sh.in | 4 +- .../pgsql/upgrade_006.1_to_006.2.sh.in | 4 +- .../pgsql/upgrade_006.2_to_007.0.sh.in | 4 +- .../scripts/pgsql/upgrade_007_to_008.sh.in | 4 +- .../scripts/pgsql/upgrade_008_to_009.sh.in | 4 +- .../scripts/pgsql/upgrade_009_to_010.sh.in | 4 +- .../scripts/pgsql/upgrade_010_to_011.sh.in | 4 +- .../database/scripts/pgsql/wipe_data.sh.in | 4 +- 44 files changed, 233 insertions(+), 122 deletions(-) diff --git a/src/bin/admin/kea-admin.in b/src/bin/admin/kea-admin.in index b68baa81fb..256f86d629 100644 --- a/src/bin/admin/kea-admin.in +++ b/src/bin/admin/kea-admin.in @@ -58,7 +58,7 @@ fi if test -d "@sbindir@"; then kea_lfc="@sbindir@/kea-lfc" else - kea_lfc="@abs_top_srcdir@/src/bin/lfc/kea-lfc" + kea_lfc="@abs_top_builddir@/src/bin/lfc/kea-lfc" fi # Prints out usage version. @@ -344,16 +344,31 @@ mysql_upgrade() { checked_mysql_version printf '\n' + upgrade_scripts_dir=${scripts_dir}/mysql + # Check if the scripts directory exists at all. - if [ ! -d ${scripts_dir}/mysql ]; then - log_error "Invalid scripts directory: ${scripts_dir}/mysql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find "${scripts_dir}/mysql" -name 'upgrade*.sh' -type f | wc -l) + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + if [ "$num_files" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "$num_files" -eq 0 ]; then - log_error "No scripts in ${scripts_dir}/mysql or the directory is not readable or does not have any upgrade* scripts." + log_error "No scripts in ${upgrade_scripts_dir} or the directory is not readable or does not have any upgrade* scripts." exit 1 fi @@ -363,7 +378,7 @@ mysql_upgrade() { printf "Verifying upgrade permissions for %s\n" "$db_user" mysql_can_create - for script in "${scripts_dir}"/mysql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do echo "Processing $script file..." "${script}" --host="${db_host}" --user="${db_user}" \ @@ -379,16 +394,31 @@ pgsql_upgrade() { version=$(checked_pgsql_version) printf "Database version reported before upgrade: %s\n" "$version" + upgrade_scripts_dir=${scripts_dir}/pgsql + # Check if the scripts directory exists at all. - if [ ! -d ${scripts_dir}/pgsql ]; then - log_error "Invalid scripts directory: ${scripts_dir}/pgsql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find "${scripts_dir}/pgsql" -name 'upgrade*.sh' -type f | wc -l) + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + if [ "$num_files" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "$num_files" -eq 0 ]; then - log_error "No scripts in ${scripts_dir}/pgsql or the directory is not readable or does not have any upgrade* scripts." + log_error "No scripts in ${upgrade_scripts_dir} or the directory is not readable or does not have any upgrade* scripts." exit 1 fi @@ -396,7 +426,7 @@ pgsql_upgrade() { # thru an env export PGPASSWORD=$db_password - for script in "${scripts_dir}"/pgsql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do echo "Processing $script file..." "${script}" -U "${db_user}" -h "${db_host}" \ diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index 5d65fc0e02..65b88a2916 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -64,7 +64,6 @@ run_statement() { fi } - # Wipe all tables from the DB: mysql_wipe() { printf "Wiping whole database %s...\n" "${db_name}" @@ -158,7 +157,7 @@ INSERT INTO schema_version VALUES (1, 7);' } mysql_db_version_with_extra_test() { - test_start "mysql.db-version-with-extra" + test_start "mysql.db-version_with_extra" # Let's wipe the whole database mysql_wipe @@ -189,13 +188,13 @@ INSERT INTO schema_version VALUES (1, 7);' # Multiple -x. run_command \ "${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -x --protocol=TCP -x --hello 2> "@abs_top_srcdir@/src/bin/admin/test-data" + -x --protocol=TCP -x --hello 2> "@abs_top_builddir@/src/bin/admin/test-data" assert_eq 2 "${EXIT_CODE}" "kea-admin -x -x succeeded. (expected %d, exit code %d)" - if ! grep -F "unknown option '--hello'" "@abs_top_srcdir@/src/bin/admin/test-data"; then + if ! grep -F "unknown option '--hello'" "@abs_top_builddir@/src/bin/admin/test-data"; then printf 'second parameter --hello was not passed to mysql with -x\n' test_finish 1 fi - rm -f "@abs_top_srcdir@/src/bin/admin/test-data" + rm -f "@abs_top_builddir@/src/bin/admin/test-data" # Let's wipe the whole database mysql_wipe @@ -268,20 +267,35 @@ mysql_host_reservation_init_test() { mysql_upgrade_schema_to_version() { target_version=$1 + upgrade_scripts_dir=${db_scripts_dir}/mysql + # Check if the scripts directory exists at all. - if [ ! -d ${db_scripts_dir}/mysql ]; then - log_error "Invalid scripts directory: ${db_scripts_dir}/mysql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find ${db_scripts_dir}/mysql/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir}/upgrade*.sh -type f | wc -l) + if [ "${num_files}" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "${num_files}" -eq 0 ]; then - log_error "No scripts in ${db_scripts_dir}/mysql?" + log_error "No scripts in ${upgrade_scripts_dir}?" exit 1 fi - for script in "${db_scripts_dir}"/mysql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do version=$(mysql_version) if [ "${version}" = "${target_version}" ] @@ -1381,8 +1395,9 @@ insert into lease4 values(12,22,NULL,40,(SELECT FROM_UNIXTIME(1643212345)),50,1, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff ${ref_file} ${output_file})" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database mysql_wipe @@ -1443,8 +1458,9 @@ insert into lease6 values('::12',22,30,(SELECT FROM_UNIXTIME(1643212345)),40,50, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff ${ref_file} ${output_file})" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database mysql_wipe @@ -1457,7 +1473,14 @@ mysql_lease4_upload_test() { test_start "mysql.lease4_upload_test${1-}" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. mysql_wipe @@ -1502,8 +1525,13 @@ mysql_lease4_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff ${input_file} ${output_file})" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. mysql_wipe @@ -1516,7 +1544,14 @@ mysql_lease6_upload_test() { test_start "mysql.lease6_upload_test${1-}" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. mysql_wipe @@ -1561,8 +1596,13 @@ mysql_lease6_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff ${input_file} ${output_file})" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. mysql_wipe @@ -2359,8 +2399,8 @@ mysql_lease4_upload_test mysql_lease4_upload_test -y mysql_lease6_upload_test mysql_lease6_upload_test -y -mysql_lease6_stat_test mysql_lease4_stat_test +mysql_lease6_stat_test mysql_lease_stat_upgrade_test mysql_lease_stat_recount_test mysql_unused_subnet_id_test diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index fb776e668e..862dbcd22d 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -761,7 +761,7 @@ pgsql_upgrade_12_to_13_test() { } pgsql_upgrade_test() { - test_start "pgsql.upgrade-test" + test_start "pgsql.upgrade" # Wipe the whole database pgsql_wipe @@ -883,8 +883,9 @@ insert into lease4 values(12,E'\\\\x3232','',40,TO_TIMESTAMP(1643212345),50,'t', cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff "${ref_file}" "${output_file}")" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database pgsql_wipe @@ -956,8 +957,9 @@ insert into lease6 values('::12',E'\\\\x3232',30,TO_TIMESTAMP(1643212345),40,50, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff "${ref_file}" "${output_file}")" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database pgsql_wipe @@ -970,7 +972,14 @@ pgsql_lease4_upload_test() { test_start "pgsql.lease4_upload_test" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. pgsql_wipe @@ -1013,8 +1022,13 @@ pgsql_lease4_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff "${input_file}" "${output_file}")" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. pgsql_wipe @@ -1026,7 +1040,14 @@ pgsql_lease6_upload_test() { test_start "pgsql.lease6_upload_test" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. pgsql_wipe @@ -1069,8 +1090,13 @@ pgsql_lease6_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff "${input_file}" "${output_file}")" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. pgsql_wipe @@ -1083,16 +1109,31 @@ pgsql_lease6_upload_test() { pgsql_upgrade_schema_to_version() { target_version=$1 + upgrade_scripts_dir=${db_scripts_dir}/pgsql + # Check if the scripts directory exists at all. - if [ ! -d ${db_scripts_dir}/pgsql ]; then - log_error "Invalid scripts directory: ${db_scripts_dir}/pgsql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find ${db_scripts_dir}/pgsql/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir}/upgrade*.sh -type f | wc -l) + if [ "${num_files}" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "${num_files}" -eq 0 ]; then - log_error "No scripts in ${db_scripts_dir}/pgsql?" + log_error "No scripts in ${upgrade_scripts_dir}?" exit 1 fi @@ -1100,7 +1141,7 @@ pgsql_upgrade_schema_to_version() { # thru an env export PGPASSWORD=$db_password - for script in "${db_scripts_dir}"/pgsql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do version=$(pgsql_version) if [ "${version}" = "${target_version}" ] diff --git a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in index efbc2c8876..f9e3a1b0a1 100644 --- a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in index 78af24afb1..ad8b843071 100644 --- a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in b/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in index 3affd3af17..10cc7ff7d8 100644 --- a/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in b/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in index 65a57ed0be..34b81cbcdd 100644 --- a/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in b/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in index cfe3489b31..607fc03f3e 100644 --- a/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in b/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in index 45f40b99e1..d129a72bb0 100644 --- a/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in b/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in index 498787890b..415995c567 100644 --- a/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in b/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in index 63392c868b..43a8e871a0 100644 --- a/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in b/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in index 5d83da5866..4d1a2f7d37 100644 --- a/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in b/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in index bba08bc7dc..6d6c52a425 100644 --- a/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in b/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in index f2c3e4989e..e4e5fb3ae6 100644 --- a/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in b/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in index 4ad298e98e..d3243e31b8 100644 --- a/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in @@ -22,8 +22,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in b/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in index fdbf17dda4..c0d6ebf225 100644 --- a/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in b/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in index 473a18f5e2..86a2203483 100644 --- a/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in b/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in index 3b8cd34bf2..ef9d0c29d2 100644 --- a/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in b/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in index 76e8608ac7..eb76089ce6 100644 --- a/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in b/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in index 69b3f65e34..bd05fbe3af 100644 --- a/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in b/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in index ebf3117f80..c02e10cf32 100644 --- a/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in b/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in index 717730b40b..a99a46d61d 100644 --- a/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in b/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in index 1b01cad822..9e33e8b7f8 100644 --- a/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in b/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in index c5f512abb3..3d3e599925 100644 --- a/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in +++ b/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in b/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in index c4142b2a17..5b73e9a1c1 100644 --- a/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in +++ b/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in b/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in index ee133d5928..09e0cfc8f6 100644 --- a/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in +++ b/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/wipe_data.sh.in b/src/share/database/scripts/mysql/wipe_data.sh.in index 83a6f3f8c0..a31ca37745 100644 --- a/src/share/database/scripts/mysql/wipe_data.sh.in +++ b/src/share/database/scripts/mysql/wipe_data.sh.in @@ -25,8 +25,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in b/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in index 658c92e632..1a7378a51c 100644 --- a/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in b/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in index bf793530bc..6683c39095 100644 --- a/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in b/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in index d5013cdd7a..48a8e1be51 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in b/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in index f9ec2bb9d8..79ba6501e9 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in b/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in index 6933c16f50..c39e593973 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in b/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in index d7a0885280..200e8937e6 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in b/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in index 62c861d5f3..be62005d8b 100644 --- a/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in b/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in index bd3f5d1609..c99a417864 100644 --- a/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in b/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in index b1bf2d3793..f66520b3e7 100644 --- a/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in b/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in index b036c529f8..260196d360 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in b/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in index 76bb8cd32c..38149a30cd 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in b/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in index 0feeb0ae0d..a2065b2739 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in b/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in index fe186522a6..f101dbdaa3 100644 --- a/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in b/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in index b68ebf6bf7..64df2c3b99 100644 --- a/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in b/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in index 4c66c427ad..cc8ff00f16 100644 --- a/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in b/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in index 625265749c..7c35387a4d 100644 --- a/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/wipe_data.sh.in b/src/share/database/scripts/pgsql/wipe_data.sh.in index 088b802e24..c19339cb09 100644 --- a/src/share/database/scripts/pgsql/wipe_data.sh.in +++ b/src/share/database/scripts/pgsql/wipe_data.sh.in @@ -25,8 +25,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi -- GitLab From 7f490a85594aa1fe9035f7c413f36cfc486480de Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 20 Jun 2022 18:31:45 +0300 Subject: [PATCH 03/14] [#2071] fixed use of valgrind --- src/bin/agent/tests/Makefile.am | 3 +-- src/bin/d2/tests/Makefile.am | 3 +-- src/bin/dhcp4/tests/Makefile.am | 3 +-- src/bin/dhcp6/tests/Makefile.am | 3 +-- src/bin/lfc/tests/Makefile.am | 3 +-- src/bin/netconf/tests/Makefile.am | 3 +-- src/bin/perfdhcp/tests/Makefile.am | 3 +-- src/hooks/dhcp/bootp/tests/Makefile.am | 3 ++- src/hooks/dhcp/flex_option/libloadtests/Makefile.am | 3 ++- src/hooks/dhcp/flex_option/tests/Makefile.am | 3 ++- src/hooks/dhcp/high_availability/libloadtests/Makefile.am | 3 ++- src/hooks/dhcp/high_availability/tests/Makefile.am | 3 +-- src/hooks/dhcp/lease_cmds/tests/Makefile.am | 3 ++- src/hooks/dhcp/mysql_cb/tests/Makefile.am | 3 +-- src/hooks/dhcp/pgsql_cb/tests/Makefile.am | 3 +-- src/hooks/dhcp/run_script/libloadtests/Makefile.am | 3 ++- src/hooks/dhcp/run_script/tests/Makefile.am | 3 ++- src/hooks/dhcp/stat_cmds/tests/Makefile.am | 3 ++- src/hooks/dhcp/user_chk/tests/Makefile.am | 3 +-- src/lib/asiodns/tests/Makefile.am | 3 +-- src/lib/asiolink/tests/Makefile.am | 3 +-- src/lib/cc/tests/Makefile.am | 3 +-- src/lib/cfgrpt/tests/Makefile.am | 3 +-- src/lib/config/tests/Makefile.am | 3 +-- src/lib/config_backend/tests/Makefile.am | 3 +-- src/lib/cryptolink/tests/Makefile.am | 3 +-- src/lib/d2srv/tests/Makefile.am | 3 +-- src/lib/database/tests/Makefile.am | 3 +-- src/lib/dhcp/tests/Makefile.am | 3 +-- src/lib/dhcp_ddns/tests/Makefile.am | 3 +-- src/lib/dhcpsrv/tests/Makefile.am | 3 +-- src/lib/dns/tests/Makefile.am | 3 +-- src/lib/eval/tests/Makefile.am | 3 +-- src/lib/exceptions/tests/Makefile.am | 3 +-- src/lib/hooks/tests/Makefile.am | 3 +-- src/lib/http/tests/Makefile.am | 3 +-- src/lib/log/interprocess/tests/Makefile.am | 3 +-- src/lib/log/tests/Makefile.am | 3 +-- src/lib/mysql/tests/Makefile.am | 3 +-- src/lib/pgsql/tests/Makefile.am | 3 +-- src/lib/process/tests/Makefile.am | 3 +-- src/lib/util/tests/Makefile.am | 3 +-- src/lib/yang/tests/Makefile.am | 3 +-- 43 files changed, 51 insertions(+), 78 deletions(-) diff --git a/src/bin/agent/tests/Makefile.am b/src/bin/agent/tests/Makefile.am index 40ac32765c..9c279d71c8 100644 --- a/src/bin/agent/tests/Makefile.am +++ b/src/bin/agent/tests/Makefile.am @@ -6,8 +6,7 @@ EXTRA_DIST += testdata/hiddenp EXTRA_DIST += testdata/hiddens EXTRA_DIST += testdata/hiddenu -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = ca_process_tests.sh diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am index b47513278e..09ef42efed 100644 --- a/src/bin/d2/tests/Makefile.am +++ b/src/bin/d2/tests/Makefile.am @@ -5,8 +5,7 @@ EXTRA_DIST = EXTRA_DIST += testdata/d2_cfg_tests.json EXTRA_DIST += testdata/get_config.json -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = d2_process_tests.sh diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am index 291d29f284..9b662d7c40 100644 --- a/src/bin/dhcp4/tests/Makefile.am +++ b/src/bin/dhcp4/tests/Makefile.am @@ -3,8 +3,7 @@ SUBDIRS = . # Add to the tarball: EXTRA_DIST = get_config_unittest.cc.skel -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp4_process_tests.sh diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index 78c7166312..3970fd9eaf 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -3,8 +3,7 @@ SUBDIRS = . # Add to the tarball: EXTRA_DIST = get_config_unittest.cc.skel -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp6_process_tests.sh diff --git a/src/bin/lfc/tests/Makefile.am b/src/bin/lfc/tests/Makefile.am index edba11847d..e2d31f65cb 100644 --- a/src/bin/lfc/tests/Makefile.am +++ b/src/bin/lfc/tests/Makefile.am @@ -14,8 +14,7 @@ if USE_STATIC_LINK AM_LDFLAGS = -static endif -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/netconf/tests/Makefile.am b/src/bin/netconf/tests/Makefile.am index 594472579f..e736f848a4 100644 --- a/src/bin/netconf/tests/Makefile.am +++ b/src/bin/netconf/tests/Makefile.am @@ -23,8 +23,7 @@ if USE_STATIC_LINK AM_LDFLAGS = -static endif -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/perfdhcp/tests/Makefile.am b/src/bin/perfdhcp/tests/Makefile.am index c62bd70b1f..5c47ef68e3 100644 --- a/src/bin/perfdhcp/tests/Makefile.am +++ b/src/bin/perfdhcp/tests/Makefile.am @@ -16,8 +16,7 @@ CLEANFILES = *.gcno *.gcda # unit tests and have to be removed. CLEANFILES += test1.hex test2.hex test3.hex test4.hex test5.hex -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/bootp/tests/Makefile.am b/src/hooks/dhcp/bootp/tests/Makefile.am index 692a647ae2..311c6fa5d6 100644 --- a/src/hooks/dhcp/bootp/tests/Makefile.am +++ b/src/hooks/dhcp/bootp/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/flex_option/libloadtests/Makefile.am b/src/hooks/dhcp/flex_option/libloadtests/Makefile.am index 9730bee9af..8b23b0b0c6 100644 --- a/src/hooks/dhcp/flex_option/libloadtests/Makefile.am +++ b/src/hooks/dhcp/flex_option/libloadtests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/flex_option/tests/Makefile.am b/src/hooks/dhcp/flex_option/tests/Makefile.am index 8051e8de7f..508912598d 100644 --- a/src/hooks/dhcp/flex_option/tests/Makefile.am +++ b/src/hooks/dhcp/flex_option/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/high_availability/libloadtests/Makefile.am b/src/hooks/dhcp/high_availability/libloadtests/Makefile.am index 7387d710e5..a80c7fab3f 100644 --- a/src/hooks/dhcp/high_availability/libloadtests/Makefile.am +++ b/src/hooks/dhcp/high_availability/libloadtests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/high_availability/tests/Makefile.am b/src/hooks/dhcp/high_availability/tests/Makefile.am index ab3f8e38e8..838a6946c2 100644 --- a/src/hooks/dhcp/high_availability/tests/Makefile.am +++ b/src/hooks/dhcp/high_availability/tests/Makefile.am @@ -21,8 +21,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/lease_cmds/tests/Makefile.am b/src/hooks/dhcp/lease_cmds/tests/Makefile.am index 8b2efcc27f..f8ab706e4e 100644 --- a/src/hooks/dhcp/lease_cmds/tests/Makefile.am +++ b/src/hooks/dhcp/lease_cmds/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/mysql_cb/tests/Makefile.am b/src/hooks/dhcp/mysql_cb/tests/Makefile.am index 49d519e815..e45f37feed 100644 --- a/src/hooks/dhcp/mysql_cb/tests/Makefile.am +++ b/src/hooks/dhcp/mysql_cb/tests/Makefile.am @@ -16,8 +16,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/pgsql_cb/tests/Makefile.am b/src/hooks/dhcp/pgsql_cb/tests/Makefile.am index 146885d2b6..81341543c8 100644 --- a/src/hooks/dhcp/pgsql_cb/tests/Makefile.am +++ b/src/hooks/dhcp/pgsql_cb/tests/Makefile.am @@ -16,8 +16,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/run_script/libloadtests/Makefile.am b/src/hooks/dhcp/run_script/libloadtests/Makefile.am index 439045af15..97fd7bb78f 100644 --- a/src/hooks/dhcp/run_script/libloadtests/Makefile.am +++ b/src/hooks/dhcp/run_script/libloadtests/Makefile.am @@ -18,7 +18,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/run_script/tests/Makefile.am b/src/hooks/dhcp/run_script/tests/Makefile.am index acff08d54d..730e4a029c 100644 --- a/src/hooks/dhcp/run_script/tests/Makefile.am +++ b/src/hooks/dhcp/run_script/tests/Makefile.am @@ -25,7 +25,8 @@ CLEANFILES = *.gcno *.gcda DISTCLEANFILES = run_script_test.sh -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/stat_cmds/tests/Makefile.am b/src/hooks/dhcp/stat_cmds/tests/Makefile.am index a0116ae4d8..5dfb8e0c0f 100644 --- a/src/hooks/dhcp/stat_cmds/tests/Makefile.am +++ b/src/hooks/dhcp/stat_cmds/tests/Makefile.am @@ -24,7 +24,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/user_chk/tests/Makefile.am b/src/hooks/dhcp/user_chk/tests/Makefile.am index 36ad55c7d8..c37c28ee79 100644 --- a/src/hooks/dhcp/user_chk/tests/Makefile.am +++ b/src/hooks/dhcp/user_chk/tests/Makefile.am @@ -20,8 +20,7 @@ EXTRA_DIST = test_users_1.txt test_users_err.txt CLEANFILES = *.gcno *.gcda DISTCLEANFILES = test_data_files_config.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/asiodns/tests/Makefile.am b/src/lib/asiodns/tests/Makefile.am index 09ff27ef75..74517c10ea 100644 --- a/src/lib/asiodns/tests/Makefile.am +++ b/src/lib/asiodns/tests/Makefile.am @@ -9,8 +9,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/asiolink/tests/Makefile.am b/src/lib/asiolink/tests/Makefile.am index a402e92267..b4be99784f 100644 --- a/src/lib/asiolink/tests/Makefile.am +++ b/src/lib/asiolink/tests/Makefile.am @@ -17,8 +17,7 @@ DISTCLEANFILES = process_spawn_app.sh noinst_SCRIPTS = process_spawn_app.sh -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cc/tests/Makefile.am b/src/lib/cc/tests/Makefile.am index 2abfb8c328..c1e0a6b0a1 100644 --- a/src/lib/cc/tests/Makefile.am +++ b/src/lib/cc/tests/Makefile.am @@ -8,8 +8,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cfgrpt/tests/Makefile.am b/src/lib/cfgrpt/tests/Makefile.am index 408dbadbe7..cda5ed9bf2 100644 --- a/src/lib/cfgrpt/tests/Makefile.am +++ b/src/lib/cfgrpt/tests/Makefile.am @@ -10,8 +10,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/config/tests/Makefile.am b/src/lib/config/tests/Makefile.am index b58dada343..8b4fdd82cc 100644 --- a/src/lib/config/tests/Makefile.am +++ b/src/lib/config/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda DISTCLEANFILES = data_def_unittests_config.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/config_backend/tests/Makefile.am b/src/lib/config_backend/tests/Makefile.am index 9e254b5959..a58d143942 100644 --- a/src/lib/config_backend/tests/Makefile.am +++ b/src/lib/config_backend/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cryptolink/tests/Makefile.am b/src/lib/cryptolink/tests/Makefile.am index a18618e5ae..a8bbb47123 100644 --- a/src/lib/cryptolink/tests/Makefile.am +++ b/src/lib/cryptolink/tests/Makefile.am @@ -10,8 +10,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/d2srv/tests/Makefile.am b/src/lib/d2srv/tests/Makefile.am index 436cb21ee1..b1fffe820d 100644 --- a/src/lib/d2srv/tests/Makefile.am +++ b/src/lib/d2srv/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/database/tests/Makefile.am b/src/lib/database/tests/Makefile.am index dd39beef93..f4cf4f0d3e 100644 --- a/src/lib/database/tests/Makefile.am +++ b/src/lib/database/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcp/tests/Makefile.am b/src/lib/dhcp/tests/Makefile.am index 33d74f2529..a140fc0a12 100644 --- a/src/lib/dhcp/tests/Makefile.am +++ b/src/lib/dhcp/tests/Makefile.am @@ -13,8 +13,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcp_ddns/tests/Makefile.am b/src/lib/dhcp_ddns/tests/Makefile.am index e1f27d1fa2..c504ca9770 100644 --- a/src/lib/dhcp_ddns/tests/Makefile.am +++ b/src/lib/dhcp_ddns/tests/Makefile.am @@ -13,8 +13,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am index 8252ebad23..495fef6f73 100644 --- a/src/lib/dhcpsrv/tests/Makefile.am +++ b/src/lib/dhcpsrv/tests/Makefile.am @@ -16,8 +16,7 @@ endif CLEANFILES = *.gcno *.gcda DISTCLEANFILES = test_libraries.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dns/tests/Makefile.am b/src/lib/dns/tests/Makefile.am index 9b2e0fadc3..bf0ab4195d 100644 --- a/src/lib/dns/tests/Makefile.am +++ b/src/lib/dns/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/eval/tests/Makefile.am b/src/lib/eval/tests/Makefile.am index f9d5a9e5a5..5a33f32e3f 100644 --- a/src/lib/eval/tests/Makefile.am +++ b/src/lib/eval/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/exceptions/tests/Makefile.am b/src/lib/exceptions/tests/Makefile.am index 0e4d2293d5..5df69bd825 100644 --- a/src/lib/exceptions/tests/Makefile.am +++ b/src/lib/exceptions/tests/Makefile.am @@ -7,8 +7,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/hooks/tests/Makefile.am b/src/lib/hooks/tests/Makefile.am index c9ea1a1ba1..dea7f4e41d 100644 --- a/src/lib/hooks/tests/Makefile.am +++ b/src/lib/hooks/tests/Makefile.am @@ -19,8 +19,7 @@ CLEANFILES = *.gcno *.gcda $(builddir)/marker_file.dat # Files generated by configure DISTCLEANFILES = marker_file.h test_libraries.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/http/tests/Makefile.am b/src/lib/http/tests/Makefile.am index c440fad5cd..51647db602 100644 --- a/src/lib/http/tests/Makefile.am +++ b/src/lib/http/tests/Makefile.am @@ -21,8 +21,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/log/interprocess/tests/Makefile.am b/src/lib/log/interprocess/tests/Makefile.am index a1f8a73113..a51a4b34a6 100644 --- a/src/lib/log/interprocess/tests/Makefile.am +++ b/src/lib/log/interprocess/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/log/tests/Makefile.am b/src/lib/log/tests/Makefile.am index 145d8093e5..668c3671d8 100644 --- a/src/lib/log/tests/Makefile.am +++ b/src/lib/log/tests/Makefile.am @@ -80,8 +80,7 @@ noinst_SCRIPTS = $(SHTESTS) if HAVE_GTEST -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Set of unit tests for the general logging classes PROGRAM_TESTS = run_unittests diff --git a/src/lib/mysql/tests/Makefile.am b/src/lib/mysql/tests/Makefile.am index f11254e3c7..b0945f298f 100644 --- a/src/lib/mysql/tests/Makefile.am +++ b/src/lib/mysql/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/pgsql/tests/Makefile.am b/src/lib/pgsql/tests/Makefile.am index ac24adbf24..1250a52d03 100644 --- a/src/lib/pgsql/tests/Makefile.am +++ b/src/lib/pgsql/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/process/tests/Makefile.am b/src/lib/process/tests/Makefile.am index 4d016456e9..7c1a43059a 100644 --- a/src/lib/process/tests/Makefile.am +++ b/src/lib/process/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/util/tests/Makefile.am b/src/lib/util/tests/Makefile.am index fd696504d6..8b6a612e75 100644 --- a/src/lib/util/tests/Makefile.am +++ b/src/lib/util/tests/Makefile.am @@ -17,8 +17,7 @@ CLEANFILES = *.gcno *.gcda # CSV files are created by unit tests for CSVFile class. CLEANFILES += *.csv -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/yang/tests/Makefile.am b/src/lib/yang/tests/Makefile.am index 9fe769326a..09c42d7ef5 100644 --- a/src/lib/yang/tests/Makefile.am +++ b/src/lib/yang/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST -- GitLab From 2a5f4014ffc2a1f149b69436f754a3117712f350 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 20 Jun 2022 18:46:43 +0300 Subject: [PATCH 04/14] [#2071] fixed rebase --- src/bin/agent/ca_process.cc | 2 +- src/bin/keactrl/Makefile.am | 17 +++++++++++------ src/lib/hooks/tests/Makefile.am | 5 ++--- .../scripts/mysql/upgrade_013_to_014.sh.in | 4 ++-- .../scripts/pgsql/upgrade_011_to_012.sh.in | 4 ++-- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/bin/agent/ca_process.cc b/src/bin/agent/ca_process.cc index 8c47377a78..1fad8db9b4 100644 --- a/src/bin/agent/ca_process.cc +++ b/src/bin/agent/ca_process.cc @@ -197,7 +197,7 @@ void CtrlAgentProcess::garbageCollectListeners(size_t leaving) { // We expect only one active listener. If there are more (most likely 2), // it means we have just reconfigured the server and need to shut down all - // listeners execept the most recently added. + // listeners except the most recently added. if (http_listeners_.size() > leaving) { // Stop no longer used listeners. for (auto l = http_listeners_.begin(); diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am index ca9f255726..aee58bdebb 100644 --- a/src/bin/keactrl/Makefile.am +++ b/src/bin/keactrl/Makefile.am @@ -3,8 +3,10 @@ SUBDIRS = . tests # Install keactrl in sbin and the keactrl.conf required by the keactrl # in etc. keactrl will look for its configuration file in the etc folder. sbin_SCRIPTS = keactrl -KEA_CONFIGFILES = \ - kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf kea-ctrl-agent.conf +KEA_CONFIGFILES = kea-dhcp4.conf +KEA_CONFIGFILES += kea-dhcp6.conf +KEA_CONFIGFILES += kea-dhcp-ddns.conf +KEA_CONFIGFILES += kea-ctrl-agent.conf if HAVE_SYSREPO KEA_CONFIGFILES += kea-netconf.conf @@ -14,10 +16,13 @@ CONFIGFILES = keactrl.conf $(KEA_CONFIGFILES) DISTCLEANFILES = keactrl keactrl.conf CLEANFILES = $(KEA_CONFIGFILES) -EXTRA_DIST = \ - keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \ - kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \ - kea-ctrl-agent.conf.pre kea-netconf.conf.pre +EXTRA_DIST = keactrl.in +EXTRA_DIST += keactrl.conf.in +EXTRA_DIST += kea-dhcp4.conf.pre +EXTRA_DIST += kea-dhcp6.conf.pre +EXTRA_DIST += kea-dhcp-ddns.conf.pre +EXTRA_DIST += kea-ctrl-agent.conf.pre +EXTRA_DIST += kea-netconf.conf.pre # *.conf files are not really sources used for building other targets, but we need # these files to be generated before make install is called. diff --git a/src/lib/hooks/tests/Makefile.am b/src/lib/hooks/tests/Makefile.am index dea7f4e41d..f0f5b048f5 100644 --- a/src/lib/hooks/tests/Makefile.am +++ b/src/lib/hooks/tests/Makefile.am @@ -37,9 +37,8 @@ if HAVE_GTEST # to unexpected errors. For this reason, the --enable-static-link option is # ignored for unit tests built here. -noinst_LTLIBRARIES = \ - libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \ - liblecl.la libucl.la libfcl.la libpcl.la libacl.la +noinst_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la +noinst_LTLIBRARIES += liblecl.la libucl.la libfcl.la libpcl.la libacl.la # -rpath /nowhere is a hack to trigger libtool to not create a # convenience archive, resulting in shared modules diff --git a/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in b/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in index b442ef3bfe..82c3ff5138 100644 --- a/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in +++ b/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in b/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in index 00a02dcea2..e7ab2c316e 100644 --- a/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi -- GitLab From 50d2f5f1d27810a4994d145314558507c643ee81 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 20 Jun 2022 21:22:33 +0300 Subject: [PATCH 05/14] [#2071] fixed CI --- src/share/database/scripts/mysql/dhcpdb_create.mysql | 3 ++- src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in | 3 ++- src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql index c4b0bdc170..7eeb7cb47b 100644 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@ -146,7 +146,8 @@ INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID'); # Hardware address extracted from docsis options INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS'); -UPDATE schema_version SET version='2', minor='0'; +UPDATE schema_version +SET version = '2', minor = '0'; # This line concludes database upgrade to version 2.0. diff --git a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in index f9e3a1b0a1..1e1608966f 100644 --- a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in @@ -53,5 +53,6 @@ INSERT INTO lease_hwaddr_source VALUES (16, 'HWADDR_SOURCE_REMOTE_ID'); INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID'); INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS'); -UPDATE schema_version SET version='2', minor='0'; +UPDATE schema_version +SET version = '2', minor = '0'; EOF diff --git a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in index ad8b843071..a6c1f2e234 100644 --- a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in @@ -114,5 +114,6 @@ END $$ DELIMITER ; -UPDATE schema_version SET version='3', minor='0'; +UPDATE schema_version +SET version = '3', minor = '0'; EOF -- GitLab From 5d54cc8ed2c5b0fb43819177d35fc88f83918d80 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 28 Jul 2022 22:14:08 +0300 Subject: [PATCH 06/14] [#2071] fixed rebase --- src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in b/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in index bb45b9e732..8b6cb1d351 100644 --- a/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi -- GitLab From b8947eda6368e7b0237420b581e7b5f21083c23a Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Fri, 29 Jul 2022 13:41:01 +0300 Subject: [PATCH 07/14] [#2071] fixed distcheck --- doc/examples/kea4/dhcpv4-over-dhcpv6.json | 2 +- doc/examples/kea6/dhcpv4-over-dhcpv6.json | 16 ++-- src/bin/dhcp4/tests/dhcp4_srv_unittest.cc | 88 ++++++++++++++++++++-- src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 91 +++++++++++++++++++++-- 4 files changed, 175 insertions(+), 22 deletions(-) diff --git a/doc/examples/kea4/dhcpv4-over-dhcpv6.json b/doc/examples/kea4/dhcpv4-over-dhcpv6.json index 52cdc1c1ac..729d4a15b1 100644 --- a/doc/examples/kea4/dhcpv4-over-dhcpv6.json +++ b/doc/examples/kea4/dhcpv4-over-dhcpv6.json @@ -12,7 +12,7 @@ "lease-database": { "type": "memfile", - "name": "leases4", + "name": "/tmp/kea-dhcp4.csv", "lfc-interval": 3600 }, diff --git a/doc/examples/kea6/dhcpv4-over-dhcpv6.json b/doc/examples/kea6/dhcpv4-over-dhcpv6.json index 68d5675323..e811ca0d3e 100644 --- a/doc/examples/kea6/dhcpv4-over-dhcpv6.json +++ b/doc/examples/kea6/dhcpv4-over-dhcpv6.json @@ -12,8 +12,8 @@ }, "lease-database": { - "type": "memfile", - "name": "leases6" + "type": "memfile", + "name": "/tmp/kea-dhcp6.csv" }, "preferred-lifetime": 3000, @@ -22,10 +22,10 @@ "rebind-timer": 2000, "subnet6": [ - { "subnet": "2001:db8:1:1::/64", - "interface": "eth0", - "pools": [ { "pool": "2001:db8:1:1::1:0/112" } ] } - ], + { "subnet": "2001:db8:1:1::/64", + "interface": "eth0", + "pools": [ { "pool": "2001:db8:1:1::1:0/112" } ] } + ], // This enables DHCPv4-over-DHCPv6 support "dhcp4o6-port": 6767, @@ -38,9 +38,9 @@ "csv-format": true, // Put the server address here "data": "2001:db8:1:1::1" } - ], + ], - "loggers": [ + "loggers": [ { "name": "kea-dhcp6", "output_options": [ diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 4e5f05f44b..4db7d779f6 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -5,12 +5,14 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include -#include #include #include #include #include +#include +#include +#include #include #include #include @@ -25,9 +27,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -36,16 +35,27 @@ #include #include #include + +#ifdef HAVE_MYSQL +#include +#endif + +#ifdef HAVE_PGSQL +#include +#endif + #include #include #include -#include +#include #include +#include using namespace std; using namespace isc; +using namespace isc::db::test; using namespace isc::dhcp; using namespace isc::data; using namespace isc::asiolink; @@ -2772,6 +2782,17 @@ Dhcpv4SrvTest::portsServerPort() { EXPECT_EQ(srv.server_port_, offer->getLocalPort()); } +#if defined (HAVE_MYSQL) +/// @brief Check if SSL/TLS support is available and configured. +bool hasMySQLTls() { + std::string tls = getMySQLTlsEnv(); + if (tls.empty()) { + tls = getMySQLTlsServer(); + } + return (tls == "YES"); +} +#endif + void Dhcpv4SrvTest::loadConfigFile(const string& path) { CfgMgr::instance().clear(); @@ -2816,6 +2837,31 @@ Dhcpv4SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp4); ElementPtr mutable_config = boost::const_pointer_cast(dhcp4); mutable_config->set(string("hooks-libraries"), Element::createList()); +#if defined (HAVE_MYSQL) + bool tls_required = false; + ConstElementPtr hosts = dhcp4->get("hosts-database"); + if (hosts) { + ConstElementPtr tls = hosts->get("trust-anchor"); + if (tls) { + tls_required = true; + } + } + hosts = dhcp4->get("hosts-databases"); + if (hosts) { + for (auto& host : hosts->listValue()) { + ConstElementPtr tls = host->get("trust-anchor"); + if (tls) { + tls_required = true; + break; + } + } + } + if (tls_required && !hasMySQLTls()) { + std::cout << "SSL/TLS support is not available or configured: " + << "skipping this test for " << path << "\n"; + return; + } +#endif ASSERT_NO_THROW(Dhcpv4SrvTest::configure(dhcp4->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -2836,8 +2882,38 @@ Dhcpv4SrvTest::loadConfigFile(const string& path) { HostMgr::setIOService(IOServicePtr()); } +/// @brief Class which handles initialization of database +/// backend for testing configurations. +class DBInitializer { + public: + /// @brief Constructor. + /// + /// Created database schema. + DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::createMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::createPgSQLSchema(); +#endif + } + + /// @brief Destructor. + /// + /// Destroys database schema. + ~DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::destroyMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::destroyPgSQLSchema(); +#endif + } +}; + void Dhcpv4SrvTest::checkConfigFiles() { + DBInitializer dbi(); IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { @@ -2928,7 +3004,7 @@ TEST_F(Dhcpv4SrvTest, portsServerPort) { portsServerPort(); } -TEST_F(Dhcpv4SrvTest, portsServerPortMultiTHreading) { +TEST_F(Dhcpv4SrvTest, portsServerPortMultiThreading) { Dhcpv4SrvMTTestGuard guard(*this, true); portsServerPort(); } diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 6026aec818..02de1486ca 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -10,6 +10,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -27,26 +31,33 @@ #include #include #include -#include +#include +#include #include #include #include -#include -#include -#include -#include + +#ifdef HAVE_MYSQL +#include +#endif + +#ifdef HAVE_PGSQL +#include +#endif #include #include -#include -#include + #include #include #include + #include +#include using namespace isc; using namespace isc::asiolink; +using namespace isc::db::test; using namespace isc::cb; using namespace isc::config; using namespace isc::data; @@ -156,6 +167,17 @@ namespace isc { namespace dhcp { namespace test { +#if defined (HAVE_MYSQL) +/// @brief Check if SSL/TLS support is available and configured. +bool hasMySQLTls() { + std::string tls = getMySQLTlsEnv(); + if (tls.empty()) { + tls = getMySQLTlsServer(); + } + return (tls == "YES"); +} +#endif + void Dhcpv6SrvTest::loadConfigFile(const string& path) { CfgMgr::instance().clear(); @@ -200,6 +222,31 @@ Dhcpv6SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp6); ElementPtr mutable_config = boost::const_pointer_cast(dhcp6); mutable_config->set(string("hooks-libraries"), Element::createList()); +#if defined (HAVE_MYSQL) + bool tls_required = false; + ConstElementPtr hosts = dhcp6->get("hosts-database"); + if (hosts) { + ConstElementPtr tls = hosts->get("trust-anchor"); + if (tls) { + tls_required = true; + } + } + hosts = dhcp6->get("hosts-databases"); + if (hosts) { + for (auto& host : hosts->listValue()) { + ConstElementPtr tls = host->get("trust-anchor"); + if (tls) { + tls_required = true; + break; + } + } + } + if (tls_required && !hasMySQLTls()) { + std::cout << "SSL/TLS support is not available or configured: " + << "skipping this test for " << path << "\n"; + return; + } +#endif ASSERT_NO_THROW(Dhcpv6SrvTest::configure(dhcp6->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -220,8 +267,38 @@ Dhcpv6SrvTest::loadConfigFile(const string& path) { HostMgr::setIOService(IOServicePtr()); } +/// @brief Class which handles initialization of database +/// backend for testing configurations. +class DBInitializer { + public: + /// @brief Constructor. + /// + /// Created database schema. + DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::createMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::createPgSQLSchema(); +#endif + } + + /// @brief Destructor. + /// + /// Destroys database schema. + ~DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::destroyMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::destroyPgSQLSchema(); +#endif + } +}; + void Dhcpv6SrvTest::checkConfigFiles() { + DBInitializer dbi(); IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { -- GitLab From 1b62b3429b4f21af6461a9052deda4f2efadafb5 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 4 Aug 2022 17:54:50 +0300 Subject: [PATCH 08/14] [#2071] addressed comments --- src/bin/dhcp4/tests/dhcp4_srv_unittest.cc | 45 +++++++++-------------- src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 45 +++++++++-------------- 2 files changed, 34 insertions(+), 56 deletions(-) diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 4db7d779f6..44f3128231 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -2782,16 +2782,21 @@ Dhcpv4SrvTest::portsServerPort() { EXPECT_EQ(srv.server_port_, offer->getLocalPort()); } -#if defined (HAVE_MYSQL) -/// @brief Check if SSL/TLS support is available and configured. -bool hasMySQLTls() { - std::string tls = getMySQLTlsEnv(); - if (tls.empty()) { - tls = getMySQLTlsServer(); +/// @brief Remove TLS parameters from configuration element. +void removeTlsParameters(ConstElementPtr elem) { + if (elem) { + ElementPtr mutable_elem = boost::const_pointer_cast(elem); + std::vector tls_parameters= { + "trust-anchor", + "cert-file", + "key-file", + "cipher-list" + }; + for (auto const& parameter : tls_parameters) { + mutable_elem->remove(parameter); + } } - return (tls == "YES"); } -#endif void Dhcpv4SrvTest::loadConfigFile(const string& path) { @@ -2837,31 +2842,15 @@ Dhcpv4SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp4); ElementPtr mutable_config = boost::const_pointer_cast(dhcp4); mutable_config->set(string("hooks-libraries"), Element::createList()); -#if defined (HAVE_MYSQL) - bool tls_required = false; + // Remove TLS parameters ConstElementPtr hosts = dhcp4->get("hosts-database"); - if (hosts) { - ConstElementPtr tls = hosts->get("trust-anchor"); - if (tls) { - tls_required = true; - } - } + removeTlsParameters(hosts); hosts = dhcp4->get("hosts-databases"); if (hosts) { for (auto& host : hosts->listValue()) { - ConstElementPtr tls = host->get("trust-anchor"); - if (tls) { - tls_required = true; - break; - } + removeTlsParameters(host); } } - if (tls_required && !hasMySQLTls()) { - std::cout << "SSL/TLS support is not available or configured: " - << "skipping this test for " << path << "\n"; - return; - } -#endif ASSERT_NO_THROW(Dhcpv4SrvTest::configure(dhcp4->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -2913,7 +2902,7 @@ class DBInitializer { void Dhcpv4SrvTest::checkConfigFiles() { - DBInitializer dbi(); + DBInitializer dbi; IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 02de1486ca..82f20b7dc7 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -167,16 +167,21 @@ namespace isc { namespace dhcp { namespace test { -#if defined (HAVE_MYSQL) -/// @brief Check if SSL/TLS support is available and configured. -bool hasMySQLTls() { - std::string tls = getMySQLTlsEnv(); - if (tls.empty()) { - tls = getMySQLTlsServer(); +/// @brief Remove TLS parameters from configuration element. +void removeTlsParameters(ConstElementPtr elem) { + if (elem) { + ElementPtr mutable_elem = boost::const_pointer_cast(elem); + std::vector tls_parameters= { + "trust-anchor", + "cert-file", + "key-file", + "cipher-list" + }; + for (auto const& parameter : tls_parameters) { + mutable_elem->remove(parameter); + } } - return (tls == "YES"); } -#endif void Dhcpv6SrvTest::loadConfigFile(const string& path) { @@ -222,31 +227,15 @@ Dhcpv6SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp6); ElementPtr mutable_config = boost::const_pointer_cast(dhcp6); mutable_config->set(string("hooks-libraries"), Element::createList()); -#if defined (HAVE_MYSQL) - bool tls_required = false; + // Remove TLS parameters ConstElementPtr hosts = dhcp6->get("hosts-database"); - if (hosts) { - ConstElementPtr tls = hosts->get("trust-anchor"); - if (tls) { - tls_required = true; - } - } + removeTlsParameters(hosts); hosts = dhcp6->get("hosts-databases"); if (hosts) { for (auto& host : hosts->listValue()) { - ConstElementPtr tls = host->get("trust-anchor"); - if (tls) { - tls_required = true; - break; - } + removeTlsParameters(host); } } - if (tls_required && !hasMySQLTls()) { - std::cout << "SSL/TLS support is not available or configured: " - << "skipping this test for " << path << "\n"; - return; - } -#endif ASSERT_NO_THROW(Dhcpv6SrvTest::configure(dhcp6->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -298,7 +287,7 @@ class DBInitializer { void Dhcpv6SrvTest::checkConfigFiles() { - DBInitializer dbi(); + DBInitializer dbi; IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { -- GitLab From 010855d3786b502642dfea3aa8a7c9083594842b Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 5 Aug 2022 02:29:52 +0200 Subject: [PATCH 09/14] [#2071] Fixed wipe script paths --- src/lib/mysql/testutils/Makefile.am | 1 + src/lib/mysql/testutils/mysql_schema.cc | 2 +- src/lib/mysql/testutils/mysql_schema.h | 6 +++--- src/lib/pgsql/testutils/Makefile.am | 1 + src/lib/pgsql/testutils/pgsql_schema.cc | 2 +- src/lib/pgsql/testutils/pgsql_schema.h | 6 +++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lib/mysql/testutils/Makefile.am b/src/lib/mysql/testutils/Makefile.am index 64680e639f..b4c2349b49 100644 --- a/src/lib/mysql/testutils/Makefile.am +++ b/src/lib/mysql/testutils/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = . AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib AM_CPPFLAGS += -DDATABASE_SCRIPTS_DIR=\"$(abs_top_srcdir)/src/share/database/scripts\" +AM_CPPFLAGS += -DDATABASE_WIPE_DIR=\"$(abs_top_builddir)/src/share/database/scripts\" AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CXXFLAGS = $(KEA_CXXFLAGS) diff --git a/src/lib/mysql/testutils/mysql_schema.cc b/src/lib/mysql/testutils/mysql_schema.cc index 936beb74aa..fd4f8b1534 100644 --- a/src/lib/mysql/testutils/mysql_schema.cc +++ b/src/lib/mysql/testutils/mysql_schema.cc @@ -47,7 +47,7 @@ void createMySQLSchema(bool show_err, bool force) { bool wipeMySQLData(bool show_err) { std::ostringstream cmd; - cmd << "sh " << DATABASE_SCRIPTS_DIR << "/"; + cmd << "sh " << DATABASE_WIPE_DIR << "/"; std::ostringstream version; version << MYSQL_SCHEMA_VERSION_MAJOR << "." << MYSQL_SCHEMA_VERSION_MINOR; diff --git a/src/lib/mysql/testutils/mysql_schema.h b/src/lib/mysql/testutils/mysql_schema.h index a3df21fe38..9178bc59ba 100644 --- a/src/lib/mysql/testutils/mysql_schema.h +++ b/src/lib/mysql/testutils/mysql_schema.h @@ -30,7 +30,7 @@ std::string validMySQLConnectionString(); /// function fails it will then attempt to destroy the database /// schema by running the SQL script: /// -/// /mysql/dhcpdb_drop.mysql +/// /mysql/dhcpdb_drop.mysql /// /// The default behavior of wiping the data only may be overridden /// in one of two ways: @@ -53,7 +53,7 @@ void destroyMySQLSchema(bool show_err = false, bool force = false); /// will call @c destroyMySQLSchema to forcibly remove the /// existing schema and then submits the SQL script: /// -/// /mysql/dhcpdb_create.mysql +/// /mysql/dhcpdb_create.mysql /// /// to the unit test MySQL database. /// @@ -73,7 +73,7 @@ void createMySQLSchema(bool show_err = false, bool force = false); /// /// Runs the shell script /// -/// /mysql/wipe_data.sh +/// /mysql/wipe_data.sh /// /// This will fail if there is no schema, if the existing schema /// version is incorrect (i.e. does not match MYSQL_SCHEMA_VERSION_MAJOR diff --git a/src/lib/pgsql/testutils/Makefile.am b/src/lib/pgsql/testutils/Makefile.am index c46de152e4..195f981658 100644 --- a/src/lib/pgsql/testutils/Makefile.am +++ b/src/lib/pgsql/testutils/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = . AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib AM_CPPFLAGS += -DDATABASE_SCRIPTS_DIR=\"$(abs_top_srcdir)/src/share/database/scripts\" +AM_CPPFLAGS += -DDATABASE_WIPE_DIR=\"$(abs_top_builddir)/src/share/database/scripts\" AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CXXFLAGS = $(KEA_CXXFLAGS) diff --git a/src/lib/pgsql/testutils/pgsql_schema.cc b/src/lib/pgsql/testutils/pgsql_schema.cc index 05226d5907..1cf79a5cc6 100644 --- a/src/lib/pgsql/testutils/pgsql_schema.cc +++ b/src/lib/pgsql/testutils/pgsql_schema.cc @@ -53,7 +53,7 @@ bool wipePgSQLData(bool show_err) { cmd << "export PGPASSWORD=keatest;"; // Add in the wipe shell script invocation. - cmd << " sh " << DATABASE_SCRIPTS_DIR << "/pgsql/wipe_data.sh"; + cmd << " sh " << DATABASE_WIPE_DIR << "/pgsql/wipe_data.sh"; // Add expected schema version as the wipe script's first argument. cmd << " " << PGSQL_SCHEMA_VERSION_MAJOR << "." << PGSQL_SCHEMA_VERSION_MINOR; diff --git a/src/lib/pgsql/testutils/pgsql_schema.h b/src/lib/pgsql/testutils/pgsql_schema.h index 5eada318de..5919670a59 100644 --- a/src/lib/pgsql/testutils/pgsql_schema.h +++ b/src/lib/pgsql/testutils/pgsql_schema.h @@ -30,7 +30,7 @@ std::string validPgSQLConnectionString(); /// function fails it will then attempt to destroy the database /// schema by running the SQL script: /// -/// /pgsql/dhcpdb_drop.pgsql +/// /pgsql/dhcpdb_drop.pgsql /// /// The default behavior of wiping the data only may be overridden /// in one of two ways: @@ -53,7 +53,7 @@ void destroyPgSQLSchema(bool show_err = false, bool force = false); /// call @c destroyPgSQLSchema to forcibly remove the existing /// schema and then submits the SQL script: /// -/// /pgsql/dhcpdb_create.pgsql +/// /pgsql/dhcpdb_create.pgsql /// /// to the unit test PgSQL database. /// @@ -73,7 +73,7 @@ void createPgSQLSchema(bool show_err = false, bool force = false); /// /// Runs the shell script /// -/// /pgsql/wipe_data.sh +/// /pgsql/wipe_data.sh /// /// This will fail if there is no schema, if the existing schema /// version is incorrect (i.e. does not match PGSQL_SCHEMA_VERSION_MAJOR -- GitLab From 7f0df803fd0bb311326353c8d1a85a6ce522161c Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 5 Aug 2022 10:44:17 +0200 Subject: [PATCH 10/14] [#2071] Replaced ${@} by $@ for dash --- src/bin/admin/tests/mysql_tests.sh.in | 20 ++++++++++---------- src/bin/admin/tests/pgsql_tests.sh.in | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index 65b88a2916..8216bc8b17 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -1358,7 +1358,7 @@ mysql_lease4_dump_test() { "${output_file}.tmp" \ "/tmp/$(basename "${output_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1387,7 +1387,7 @@ insert into lease4 values(12,22,NULL,40,(SELECT FROM_UNIXTIME(1643212345)),50,1, # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump mysql -4 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -1422,7 +1422,7 @@ mysql_lease6_dump_test() { "${output_file}.tmp" \ "/tmp/$(basename "${output_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1450,7 +1450,7 @@ insert into lease6 values('::12',22,30,(SELECT FROM_UNIXTIME(1643212345)),40,50, # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump mysql -6 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -1493,7 +1493,7 @@ mysql_lease4_upload_test() { "${output_file}.tmp" \ "/tmp/$(basename "${input_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1510,14 +1510,14 @@ mysql_lease4_upload_test() { run_command \ "${kea_admin}" lease-upload mysql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -4 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump mysql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1564,7 +1564,7 @@ mysql_lease6_upload_test() { "${output_file}.tmp" \ "/tmp/$(basename "${input_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1581,14 +1581,14 @@ mysql_lease6_upload_test() { run_command \ "${kea_admin}" lease-upload mysql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -6 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump mysql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 862dbcd22d..b9fbcb1fc3 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -844,7 +844,7 @@ pgsql_lease4_dump_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${output_file}" touch "${output_file}.tmp" else @@ -875,7 +875,7 @@ insert into lease4 values(12,E'\\\\x3232','',40,TO_TIMESTAMP(1643212345),50,'t', # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump pgsql -4 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -918,7 +918,7 @@ pgsql_lease6_dump_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${output_file}" touch "${output_file}.tmp" else @@ -949,7 +949,7 @@ insert into lease6 values('::12',E'\\\\x3232',30,TO_TIMESTAMP(1643212345),40,50, # Dump lease6 to output_file run_command \ "${kea_admin}" lease-dump pgsql -6 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -987,7 +987,7 @@ pgsql_lease4_upload_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${input_file}.tmp" touch "${output_file}" touch "${output_file}.tmp" @@ -1007,14 +1007,14 @@ pgsql_lease4_upload_test() { run_command \ "${kea_admin}" lease-upload pgsql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -4 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump pgsql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1055,7 +1055,7 @@ pgsql_lease6_upload_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${input_file}.tmp" touch "${output_file}" touch "${output_file}.tmp" @@ -1075,14 +1075,14 @@ pgsql_lease6_upload_test() { run_command \ "${kea_admin}" lease-upload pgsql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -6 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump pgsql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. -- GitLab From d43a731e7d3c0ce16af01cd72101e4dd0e893ae4 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 5 Aug 2022 11:51:04 +0200 Subject: [PATCH 11/14] [#2071] Check existence of file vs of a parent directory --- src/bin/admin/kea-admin.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/admin/kea-admin.in b/src/bin/admin/kea-admin.in index 256f86d629..aae0e29ea0 100644 --- a/src/bin/admin/kea-admin.in +++ b/src/bin/admin/kea-admin.in @@ -48,14 +48,14 @@ dump_file="" dump_qry="" # Include the installed admin-utils.sh if available. Fallback to sources otherwise. -if test -d "@datarootdir@/@PACKAGE_NAME@"; then +if test -f "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh"; then . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" else . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" fi # Find the installed kea-lfc if available. Fallback to sources otherwise. -if test -d "@sbindir@"; then +if test -x "@sbindir@/kea-lfc"; then kea_lfc="@sbindir@/kea-lfc" else kea_lfc="@abs_top_builddir@/src/bin/lfc/kea-lfc" -- GitLab From 749f880dc19c6038aaec2ec1789f8a5f0e532f2d Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 8 Aug 2022 16:23:39 +0200 Subject: [PATCH 12/14] [#2071] Reverted clean-local rule --- doc/sphinx/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am index bfe15ea002..7fa957bdcd 100644 --- a/doc/sphinx/Makefile.am +++ b/doc/sphinx/Makefile.am @@ -188,6 +188,7 @@ update-python-dependencies: ./src/requirements.in clean-local: rm -rf $(sphinxbuilddir) + rm -f $(srcdir)/mes-files.txt $(srcdir)/api-files.txt rm -f $(srcdir)/kea-messages.rst $(srcdir)/api.rst rm -f $(srcdir)/arm/platforms.rst -- GitLab From 2e277a61fa07911250b60151fc78c5c5a7c028ce Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 8 Aug 2022 16:47:39 +0200 Subject: [PATCH 13/14] [#2071] Fixed globing vs find --- src/bin/admin/tests/mysql_tests.sh.in | 2 +- src/bin/admin/tests/pgsql_tests.sh.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index 8216bc8b17..9151fbe73a 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -276,7 +276,7 @@ mysql_upgrade_schema_to_version() { fi # Check if there are any files in it - num_files=$(find ${upgrade_scripts_dir}/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir} -name 'upgrade*.sh' -type f | wc -l) if [ "${num_files}" -eq 0 ]; then upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index b9fbcb1fc3..54d8d6c285 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -1118,7 +1118,7 @@ pgsql_upgrade_schema_to_version() { fi # Check if there are any files in it - num_files=$(find ${upgrade_scripts_dir}/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir} -name 'upgrade*.sh' -type f | wc -l) if [ "${num_files}" -eq 0 ]; then upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql -- GitLab From ad3a6a8315a29988d53f884440626f97cb9161de Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Tue, 9 Aug 2022 13:40:19 +0300 Subject: [PATCH 14/14] [#2071] added ChangeLog --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9f47aac11e..ae80134119 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2049. [build] razvan, fdupont + The distcheck rule is able to compile and run unittests for + database backends, GSS-TSIG and Sysrepo/NETCONF. + (Gitlab #2071) + 2048. [bug] fdupont Set broadcast MAC destination address in DHCPv4 replies when the IP address is broadcast. Thanks to Joost Bekkers -- GitLab