summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2022-08-05 02:29:52 +0200
committerFrancis Dupont <fdupont@isc.org>2022-08-10 16:02:22 +0200
commit010855d3786b502642dfea3aa8a7c9083594842b (patch)
tree3af2fca6277decf60a66f5ba1185d02688a1a62e
parent[#2071] addressed comments (diff)
downloadkea-010855d3786b502642dfea3aa8a7c9083594842b.tar.xz
kea-010855d3786b502642dfea3aa8a7c9083594842b.zip
[#2071] Fixed wipe script paths
-rw-r--r--src/lib/mysql/testutils/Makefile.am1
-rw-r--r--src/lib/mysql/testutils/mysql_schema.cc2
-rw-r--r--src/lib/mysql/testutils/mysql_schema.h6
-rw-r--r--src/lib/pgsql/testutils/Makefile.am1
-rw-r--r--src/lib/pgsql/testutils/pgsql_schema.cc2
-rw-r--r--src/lib/pgsql/testutils/pgsql_schema.h6
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:
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/mysql/dhcpdb_drop.mysql
+/// <DATABASE_SCRIPT_DIR>/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:
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/mysql/dhcpdb_create.mysql
+/// <DATABASE_SCRIPTS_DIR>/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
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/mysql/wipe_data.sh
+/// <DATABASE_WIPE_DIR>/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:
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/pgsql/dhcpdb_drop.pgsql
+/// <DATABASE_SCRIPTS_DIR>/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:
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/pgsql/dhcpdb_create.pgsql
+/// <DATABASE_SCRIPTS_DIR>/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
///
-/// <TEST_ADMIN_SCRIPTS_DIR>/pgsql/wipe_data.sh
+/// <DATABASE_WIPE_DIR>/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