From: Francis Dupont Date: Sun, 22 Dec 2024 12:13:39 +0000 (+0100) Subject: [#3398] Added keatest X-Git-Tag: Kea-2.7.6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ea3244ae8d85f8d4ecfb7c143824d6aefb0ddb6;p=thirdparty%2Fkea.git [#3398] Added keatest --- diff --git a/doc/sphinx/man/kea-admin.8.rst b/doc/sphinx/man/kea-admin.8.rst index bebb8a0195..4092f00dd3 100644 --- a/doc/sphinx/man/kea-admin.8.rst +++ b/doc/sphinx/man/kea-admin.8.rst @@ -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 diff --git a/src/bin/admin/admin-utils.sh.in b/src/bin/admin/admin-utils.sh.in index 62fdc6fad4..8399168869 100644 --- a/src/bin/admin/admin-utils.sh.in +++ b/src/bin/admin/admin-utils.sh.in @@ -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 diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index 1768ba085a..cbac91e42d 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -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" diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 55acd51fff..871128b69d 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -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" diff --git a/src/lib/cc/Makefile.am b/src/lib/cc/Makefile.am index 085dddb978..a4650f12f6 100644 --- a/src/lib/cc/Makefile.am +++ b/src/lib/cc/Makefile.am @@ -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 diff --git a/src/lib/cc/default_credentials.cc b/src/lib/cc/default_credentials.cc index 327f072392..d502cc0b98 100644 --- a/src/lib/cc/default_credentials.cc +++ b/src/lib/cc/default_credentials.cc @@ -12,6 +12,9 @@ namespace data { const std::list DefaultCredentials::DEFAULT_CREDENTIALS = { #ifndef IGNORE_KEA_DEFAULT_CREDENTIALS +#ifndef ALLOW_KEATEST + "keatest", +#endif "1234", "*****" #endif #ifdef EXTRA_KEA_DEFAULT_CREDENTIALS diff --git a/src/lib/cc/default_credentials.h b/src/lib/cc/default_credentials.h index ade6fa5689..462330f2e8 100644 --- a/src/lib/cc/default_credentials.h +++ b/src/lib/cc/default_credentials.h @@ -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 DEFAULT_CREDENTIALS; /// @brief Check if the value is a default credential. diff --git a/src/lib/dhcpsrv/database_backends.dox b/src/lib/dhcpsrv/database_backends.dox index 59ad98cb46..cb0d68d8d7 100644 --- a/src/lib/dhcpsrv/database_backends.dox +++ b/src/lib/dhcpsrv/database_backends.dox @@ -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: