]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3398] Added keatest
authorFrancis Dupont <fdupont@isc.org>
Sun, 22 Dec 2024 12:13:39 +0000 (13:13 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 27 Jan 2025 14:05:12 +0000 (15:05 +0100)
doc/sphinx/man/kea-admin.8.rst
src/bin/admin/admin-utils.sh.in
src/bin/admin/tests/mysql_tests.sh.in
src/bin/admin/tests/pgsql_tests.sh.in
src/lib/cc/Makefile.am
src/lib/cc/default_credentials.cc
src/lib/cc/default_credentials.h
src/lib/dhcpsrv/database_backends.dox

index bebb8a019561d140481e4af3114d6edd0903b1e4..4092f00dd3114a465bea80847de676ecaccafb88 100644 (file)
@@ -95,7 +95,7 @@ Arguments
    If only ``-p`` or ``--password`` is given, the user is prompted for a password.
    If not specified at all, the ``KEA_ADMIN_DB_PASSWORD`` environment variable
    is checked for a value and used if it exists.
-   Otherwise the default value of ``keatest`` is used.
+   Otherwise the default value of ``1234`` is used.
 
 ``-n|--name database-name``
    Specifies the name of the database to connect to. The
index 62fdc6fad4b81151cfec03bc88515e43d037b406..83991688696a894f4dad1939f07b81819a1653f4 100644 (file)
@@ -26,10 +26,15 @@ set -eu
 # specific deployment. Also used in unit tests.
 db_host='localhost'
 db_user='keatest'
-db_password='keatest'
+db_password='1234'
 db_name='keatest'
 extra_arguments=
 
+# Set the db_password.
+set_db_password() {
+    db_password=$1
+}
+
 # Runs all the given arguments as a single command. Maintains quoting. Places
 # output in ${OUTPUT} and exit code in ${EXIT_CODE}. Does not support pipes and
 # redirections. Support for them could be added through eval and single
index 1768ba085ac7a0c3dde90c2d881f59077628d51c..cbac91e42da8751d333b6d8a635aed720cfd2ca5 100644 (file)
@@ -22,6 +22,9 @@ set -eu
 # shellcheck source=src/bin/admin/admin-utils.sh.in
 . "@abs_top_builddir@/src/bin/admin/admin-utils.sh"
 
+# Set the test database password
+set_db_password "keatest"
+
 # Set path to the production schema scripts
 db_scripts_dir="@abs_top_srcdir@/src/share/database/scripts"
 
index 55acd51fffa86abb6d4272cd25dd1c062d299aa1..871128b69db2632f77daaa0deb75e8b9a823a541 100644 (file)
@@ -22,6 +22,9 @@ set -eu
 # shellcheck source=src/bin/admin/admin-utils.sh.in
 . "@abs_top_builddir@/src/bin/admin/admin-utils.sh"
 
+# Set the test database password
+set_db_password "keatest"
+
 # Set path to the production schema scripts
 db_scripts_dir="@abs_top_srcdir@/src/share/database/scripts"
 
index 085dddb978dc3a7a77fc297ac60455846c457258..a4650f12f645034ee8a5b23dde215e68571755dd 100644 (file)
@@ -2,8 +2,12 @@ SUBDIRS = . tests
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
+if HAVE_GTEST
+AM_CPPFLAGS += -DALLOW_KEATEST
+endif
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
+
 lib_LTLIBRARIES = libkea-cc.la
 libkea_cc_la_SOURCES = base_stamped_element.cc base_stamped_element.h
 libkea_cc_la_SOURCES += data.cc data.h
index 327f072392a452953964087e78ab59be5144c4d8..d502cc0b980870c73ab0cbb647056a19c6f4bd6b 100644 (file)
@@ -12,6 +12,9 @@ namespace data {
 
 const std::list<std::string> DefaultCredentials::DEFAULT_CREDENTIALS = {
 #ifndef IGNORE_KEA_DEFAULT_CREDENTIALS
+#ifndef ALLOW_KEATEST
+    "keatest",
+#endif
     "1234", "*****"
 #endif
 #ifdef EXTRA_KEA_DEFAULT_CREDENTIALS
index ade6fa5689188dd364de14f4810c780624cb11e8..462330f2e8122f9c54bad96544b420a55695e31d 100644 (file)
@@ -25,7 +25,7 @@ public:
 struct DefaultCredentials {
     /// @brief Default credentials.
     ///
-    /// @note Using a list as there are only two default credentials.
+    /// @note Using a list as there are only a few default credentials.
     static const std::list<std::string> DEFAULT_CREDENTIALS;
 
     /// @brief Check if the value is a default credential.
index 59ad98cb46e389c822b9cc28f967a2f9b3b0f8f9..cb0d68d8d73a12773402996dd2c33cbb8dd27f1b 100644 (file)
@@ -52,7 +52,7 @@
   (no embedded spaces), each pair separated by a space from the others, e.g.
 
   \code
-  type=mysql user=keatest password=keatest name=keatest host=localhost
+  type=mysql user=keatest password=1234 name=keatest host=localhost
   \endcode
 
   The following keywords are used for all backends: