]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2071] Fixed wipe script paths
authorFrancis Dupont <fdupont@isc.org>
Fri, 5 Aug 2022 00:29:52 +0000 (02:29 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 10 Aug 2022 14:02:22 +0000 (16:02 +0200)
src/lib/mysql/testutils/Makefile.am
src/lib/mysql/testutils/mysql_schema.cc
src/lib/mysql/testutils/mysql_schema.h
src/lib/pgsql/testutils/Makefile.am
src/lib/pgsql/testutils/pgsql_schema.cc
src/lib/pgsql/testutils/pgsql_schema.h

index 64680e639f9958e6f496d513d4001b00abede2df..b4c2349b49ea6c15b429b21cb19265145612dbaa 100644 (file)
@@ -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)
index 936beb74aa75dea34d191d99635d2123a73387c0..fd4f8b15342280588a53ab5959678b07e2bd39b5 100644 (file)
@@ -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;
index a3df21fe38da0c14938ae7a9ba0103f915b5f362..9178bc59ba122da851cda39f2a9eac9a7a12f3f8 100644 (file)
@@ -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
index c46de152e46be4a3d32df7a398abec65f31dcb36..195f981658a43691fe83924bcf6cb78a2f14e45f 100644 (file)
@@ -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)
index 05226d5907f917723cdb8f942a192b898b9a9e86..1cf79a5cc6eb8c7cb47e5171673bd8a357e3ca08 100644 (file)
@@ -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;
index 5eada318de3af0bba945aa3e891cca46a321da88..5919670a591a8877991fabb6fb6898a00ee5e473 100644 (file)
@@ -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