From: Francis Dupont Date: Fri, 5 Aug 2022 00:29:52 +0000 (+0200) Subject: [#2071] Fixed wipe script paths X-Git-Tag: Kea-2.3.0~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=010855d3786b502642dfea3aa8a7c9083594842b;p=thirdparty%2Fkea.git [#2071] Fixed wipe script paths --- 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