diff --git a/ChangeLog b/ChangeLog index 9f47aac11e76f34f0fad5f5ba02002cda9f0474e..ae801341190651e5beae075e31702e4cead0d9a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2049. [build] razvan, fdupont + The distcheck rule is able to compile and run unittests for + database backends, GSS-TSIG and Sysrepo/NETCONF. + (Gitlab #2071) + 2048. [bug] fdupont Set broadcast MAC destination address in DHCPv4 replies when the IP address is broadcast. Thanks to Joost Bekkers diff --git a/Makefile.am b/Makefile.am index ebcf3e7fbedec558f67c0170c2424bc308c0637c..18b34e7eb4e03f04835ad6bca2fa2b393ca82d7b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,11 @@ DISTCHECK_PERFDHCP_CONFIGURE_FLAG=@DISTCHECK_PERFDHCP_CONFIGURE_FLAG@ DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@ DISTCHECK_PREMIUM_CONFIGURE_FLAG=@DISTCHECK_PREMIUM_CONFIGURE_FLAG@ DISTCHECK_CONTRIB_CONFIGURE_FLAG=@DISTCHECK_CONTRIB_CONFIGURE_FLAG@ +DISTCHECK_MYSQL_CONFIGURE_FLAG=@DISTCHECK_MYSQL_CONFIGURE_FLAG@ +DISTCHECK_PGSQL_CONFIGURE_FLAG=@DISTCHECK_PGSQL_CONFIGURE_FLAG@ +DISTCHECK_GSSAPI_CONFIGURE_FLAG=@DISTCHECK_GSSAPI_CONFIGURE_FLAG@ +DISTCHECK_LIBYANG_CONFIGURE_FLAG=@DISTCHECK_LIBYANG_CONFIGURE_FLAG@ +DISTCHECK_SYSREPO_CONFIGURE_FLAG=@DISTCHECK_SYSREPO_CONFIGURE_FLAG@ OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html @@ -47,6 +52,21 @@ DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PREMIUM_CONFIGURE_FLAG) # Keep the contrib config DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CONTRIB_CONFIGURE_FLAG) +# Keep the mysql config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_MYSQL_CONFIGURE_FLAG) + +# Keep the pgsql config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PGSQL_CONFIGURE_FLAG) + +# Keep the gssapi config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GSSAPI_CONFIGURE_FLAG) + +# Keep the libyang config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LIBYANG_CONFIGURE_FLAG) + +# Keep the sysrepo config +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_SYSREPO_CONFIGURE_FLAG) + dist_doc_DATA = AUTHORS COPYING ChangeLog README CONTRIBUTING.md platforms.rst code_of_conduct.md .PHONY: check-valgrind check-valgrind-suppress @@ -114,9 +134,10 @@ endif --ignore-errors gcov,source,graph \ --output report.info; \ sed --in-place --expression "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" report.info; \ - "$(GENHTML)" --frames --show-details --title 'Kea code coverage report' --legend \ - --function-coverage --ignore-errors source --demangle-cpp \ - --output "$(OVERALL_COVERAGE_DIR)" report.info; \ + "$(GENHTML)" \ + --frames --show-details --title 'Kea code coverage report' --legend \ + --function-coverage --ignore-errors source --demangle-cpp \ + --output "$(OVERALL_COVERAGE_DIR)" report.info; \ printf "Generated C++ code coverage report in HTML at %s.\n" "$(OVERALL_COVERAGE_DIR)"; \ else \ echo "C++ code coverage not enabled at configuration time." ; \ diff --git a/configure.ac b/configure.ac index 7e02660125b0bc7b179c1db325f93a03c82f04df..d8605f6378e7243270f9e6c93e7393ffef23a20f 100644 --- a/configure.ac +++ b/configure.ac @@ -677,11 +677,14 @@ elif test "${mysql_config}" != "no" ; then MYSQL_CONFIG="${withval}" fi +DISTCHECK_MYSQL_CONFIGURE_FLAG= if test "$MYSQL_CONFIG" != "" ; then if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then AC_MSG_ERROR([MySQL dependencies cannot be found. Please install MySQL libraries or point --with-mysql to mysql_config program if it is located in non-default directory, eg. --with-mysql=/opt/mysql/bin/mysql_config.]) fi + DISTCHECK_MYSQL_CONFIGURE_FLAG="--with-mysql=$MYSQL_CONFIG" + MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags` MYSQL_LIBS=`$MYSQL_CONFIG --libs` MYSQL_LIBS="$MYSQL_LIBS $CRYPTO_LIBS" @@ -689,6 +692,7 @@ if test "$MYSQL_CONFIG" != "" ; then AC_SUBST(MYSQL_CPPFLAGS) AC_SUBST(MYSQL_LIBS) + AC_SUBST(DISTCHECK_MYSQL_CONFIGURE_FLAG) # Check that a simple program using MySQL functions can compile and link. CPPFLAGS_SAVED="$CPPFLAGS" @@ -757,11 +761,14 @@ elif test "${pg_config}" != "no" ; then PG_CONFIG="${withval}" fi +DISTCHECK_PGSQL_CONFIGURE_FLAG= if test "$PG_CONFIG" != "" ; then if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then AC_MSG_ERROR([PostgreSQL dependencies cannot be found. Please install PostgreSQL libraries or point --with-pgsql to pg_config program if it is located in non-default directory, eg. --with-pgsql=/opt/pgsql/bin/pg_config.]) fi + DISTCHECK_PGSQL_CONFIGURE_FLAG="--with-pgsql=$PG_CONFIG" + PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags` PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir` PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server` @@ -772,6 +779,7 @@ if test "$PG_CONFIG" != "" ; then AC_SUBST(PGSQL_CPPFLAGS) AC_SUBST(PGSQL_LIBS) + AC_SUBST(DISTCHECK_PGSQL_CONFIGURE_FLAG) # Check that a simple program using PostgreSQL functions can compile and link. CPPFLAGS_SAVED="$CPPFLAGS" diff --git a/doc/examples/kea4/dhcpv4-over-dhcpv6.json b/doc/examples/kea4/dhcpv4-over-dhcpv6.json index 52cdc1c1acb3021e303cfa88cc83f5517ff772e4..729d4a15b11474073894e77c2d70eadfe7fec978 100644 --- a/doc/examples/kea4/dhcpv4-over-dhcpv6.json +++ b/doc/examples/kea4/dhcpv4-over-dhcpv6.json @@ -12,7 +12,7 @@ "lease-database": { "type": "memfile", - "name": "leases4", + "name": "/tmp/kea-dhcp4.csv", "lfc-interval": 3600 }, diff --git a/doc/examples/kea6/dhcpv4-over-dhcpv6.json b/doc/examples/kea6/dhcpv4-over-dhcpv6.json index 68d567532377ab4b39c283a58a15c294b01e0cc0..e811ca0d3efbfc2cffba52d21556281c69b0be26 100644 --- a/doc/examples/kea6/dhcpv4-over-dhcpv6.json +++ b/doc/examples/kea6/dhcpv4-over-dhcpv6.json @@ -12,8 +12,8 @@ }, "lease-database": { - "type": "memfile", - "name": "leases6" + "type": "memfile", + "name": "/tmp/kea-dhcp6.csv" }, "preferred-lifetime": 3000, @@ -22,10 +22,10 @@ "rebind-timer": 2000, "subnet6": [ - { "subnet": "2001:db8:1:1::/64", - "interface": "eth0", - "pools": [ { "pool": "2001:db8:1:1::1:0/112" } ] } - ], + { "subnet": "2001:db8:1:1::/64", + "interface": "eth0", + "pools": [ { "pool": "2001:db8:1:1::1:0/112" } ] } + ], // This enables DHCPv4-over-DHCPv6 support "dhcp4o6-port": 6767, @@ -38,9 +38,9 @@ "csv-format": true, // Put the server address here "data": "2001:db8:1:1::1" } - ], + ], - "loggers": [ + "loggers": [ { "name": "kea-dhcp6", "output_options": [ diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 534c18e4f7681b3308dfb7d84783b0a06a227e40..3325893a62b52e8fc211659b004729fd786c2c2c 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -6906,7 +6906,7 @@ All supported parameters can be configured via the ``cb_cmds`` hook library described in the :ref:`hooks-cb-cmds` section. The general rule is that scalar global parameters are set using ``remote-global-parameter4-set``; shared-network-specific parameters -are set using ``remote-network4-set``; and subnet- and pool-level +are set using ``remote-network4-set``; and subnet-level and pool-level parameters are set using ``remote-subnet4-set``. Whenever there is an exception to this general rule, it is highlighted in the table. Non-scalar global parameters have dedicated commands; for example, diff --git a/m4macros/ax_gssapi.m4 b/m4macros/ax_gssapi.m4 index 2360a3755e947286c247645baa62c30fc07ac8ee..539343edad50bcabcffe727cbffaca31904c528c 100644 --- a/m4macros/ax_gssapi.m4 +++ b/m4macros/ax_gssapi.m4 @@ -13,6 +13,7 @@ AC_ARG_WITH([gssapi], ENABLE_GSSAPI=no GSSAPI_CFLAGS= GSSAPI_LIBS= +DISTCHECK_GSSAPI_CONFIGURE_FLAG="--with-gssapi=$gssapi_path" AC_MSG_CHECKING([for gssapi support]) if test "x$gssapi_path" = "x" ; then @@ -86,6 +87,7 @@ fi AC_SUBST(GSSAPI_CFLAGS) AC_SUBST(GSSAPI_LIBS) +AC_SUBST(DISTCHECK_GSSAPI_CONFIGURE_FLAG) AM_CONDITIONAL([HAVE_GSSAPI], [test $ENABLE_GSSAPI = "yes"]) ])dnl AX_GSS_API diff --git a/m4macros/ax_sysrepo.m4 b/m4macros/ax_sysrepo.m4 index 415125e6b2277191fae937a31eec152f2504c516..50b30713c15f41b4d6f91e027326657373bbfbb5 100644 --- a/m4macros/ax_sysrepo.m4 +++ b/m4macros/ax_sysrepo.m4 @@ -4,10 +4,14 @@ AC_DEFUN([AX_SYSREPO], [ [AS_HELP_STRING([--with-libyang[[=PATH]]], [optional path to the libyang installation directory])], [with_libyang="${withval}"]) + DISTCHECK_LIBYANG_CONFIGURE_FLAG="--with-libyang=$with_libyang" + AC_ARG_WITH([sysrepo], [AS_HELP_STRING([--with-sysrepo[[=PATH]]], [optional path to the sysrepo installation directory])], [with_sysrepo="${withval}"]) + DISTCHECK_SYSREPO_CONFIGURE_FLAG="--with-sysrepo=$with_sysrepo" + # If --with-libyang was omitted, assume it was passed and give it the value # from --with-sysrepo. if test -z "${with_libyang}"; then @@ -220,4 +224,6 @@ AC_DEFUN([AX_SYSREPO], [ AC_SUBST(SRPD_PLUGINS_PATH) AC_SUBST(SYSREPO_VERSION) AC_SUBST(SYSREPOCPP_VERSION) + AC_SUBST(DISTCHECK_LIBYANG_CONFIGURE_FLAG) + AC_SUBST(DISTCHECK_SYSREPO_CONFIGURE_FLAG) ]) diff --git a/src/bin/admin/kea-admin.in b/src/bin/admin/kea-admin.in index b68baa81fbdf421af9625eb0216aeb11d180b041..aae0e29ea02b593cb29727bc7bffd66fd997006b 100644 --- a/src/bin/admin/kea-admin.in +++ b/src/bin/admin/kea-admin.in @@ -48,17 +48,17 @@ dump_file="" dump_qry="" # Include the installed admin-utils.sh if available. Fallback to sources otherwise. -if test -d "@datarootdir@/@PACKAGE_NAME@"; then +if test -f "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh"; then . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" else . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" fi # Find the installed kea-lfc if available. Fallback to sources otherwise. -if test -d "@sbindir@"; then +if test -x "@sbindir@/kea-lfc"; then kea_lfc="@sbindir@/kea-lfc" else - kea_lfc="@abs_top_srcdir@/src/bin/lfc/kea-lfc" + kea_lfc="@abs_top_builddir@/src/bin/lfc/kea-lfc" fi # Prints out usage version. @@ -344,16 +344,31 @@ mysql_upgrade() { checked_mysql_version printf '\n' + upgrade_scripts_dir=${scripts_dir}/mysql + # Check if the scripts directory exists at all. - if [ ! -d ${scripts_dir}/mysql ]; then - log_error "Invalid scripts directory: ${scripts_dir}/mysql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find "${scripts_dir}/mysql" -name 'upgrade*.sh' -type f | wc -l) + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + if [ "$num_files" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "$num_files" -eq 0 ]; then - log_error "No scripts in ${scripts_dir}/mysql or the directory is not readable or does not have any upgrade* scripts." + log_error "No scripts in ${upgrade_scripts_dir} or the directory is not readable or does not have any upgrade* scripts." exit 1 fi @@ -363,7 +378,7 @@ mysql_upgrade() { printf "Verifying upgrade permissions for %s\n" "$db_user" mysql_can_create - for script in "${scripts_dir}"/mysql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do echo "Processing $script file..." "${script}" --host="${db_host}" --user="${db_user}" \ @@ -379,16 +394,31 @@ pgsql_upgrade() { version=$(checked_pgsql_version) printf "Database version reported before upgrade: %s\n" "$version" + upgrade_scripts_dir=${scripts_dir}/pgsql + # Check if the scripts directory exists at all. - if [ ! -d ${scripts_dir}/pgsql ]; then - log_error "Invalid scripts directory: ${scripts_dir}/pgsql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find "${scripts_dir}/pgsql" -name 'upgrade*.sh' -type f | wc -l) + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + if [ "$num_files" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "$num_files" -eq 0 ]; then - log_error "No scripts in ${scripts_dir}/pgsql or the directory is not readable or does not have any upgrade* scripts." + log_error "No scripts in ${upgrade_scripts_dir} or the directory is not readable or does not have any upgrade* scripts." exit 1 fi @@ -396,7 +426,7 @@ pgsql_upgrade() { # thru an env export PGPASSWORD=$db_password - for script in "${scripts_dir}"/pgsql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do echo "Processing $script file..." "${script}" -U "${db_user}" -h "${db_host}" \ diff --git a/src/bin/admin/tests/data/Makefile.am b/src/bin/admin/tests/data/Makefile.am index 3e9f88dbbbb47d590f49d936e4d8142cd6e2584d..7ce62898ec142787aa66ac0a3740a094d5c13dee 100644 --- a/src/bin/admin/tests/data/Makefile.am +++ b/src/bin/admin/tests/data/Makefile.am @@ -1,3 +1,3 @@ EXTRA_DIST = \ - lease4_dump_test.reference.csv \ - lease6_dump_test.reference.csv + lease4_dump_test.reference.csv \ + lease6_dump_test.reference.csv diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index 5d65fc0e02bfc78f1217363b0b3b9eefd8ed56b3..9151fbe73a727d1752c93c6789914671a6166b1c 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -64,7 +64,6 @@ run_statement() { fi } - # Wipe all tables from the DB: mysql_wipe() { printf "Wiping whole database %s...\n" "${db_name}" @@ -158,7 +157,7 @@ INSERT INTO schema_version VALUES (1, 7);' } mysql_db_version_with_extra_test() { - test_start "mysql.db-version-with-extra" + test_start "mysql.db-version_with_extra" # Let's wipe the whole database mysql_wipe @@ -189,13 +188,13 @@ INSERT INTO schema_version VALUES (1, 7);' # Multiple -x. run_command \ "${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -x --protocol=TCP -x --hello 2> "@abs_top_srcdir@/src/bin/admin/test-data" + -x --protocol=TCP -x --hello 2> "@abs_top_builddir@/src/bin/admin/test-data" assert_eq 2 "${EXIT_CODE}" "kea-admin -x -x succeeded. (expected %d, exit code %d)" - if ! grep -F "unknown option '--hello'" "@abs_top_srcdir@/src/bin/admin/test-data"; then + if ! grep -F "unknown option '--hello'" "@abs_top_builddir@/src/bin/admin/test-data"; then printf 'second parameter --hello was not passed to mysql with -x\n' test_finish 1 fi - rm -f "@abs_top_srcdir@/src/bin/admin/test-data" + rm -f "@abs_top_builddir@/src/bin/admin/test-data" # Let's wipe the whole database mysql_wipe @@ -268,20 +267,35 @@ mysql_host_reservation_init_test() { mysql_upgrade_schema_to_version() { target_version=$1 + upgrade_scripts_dir=${db_scripts_dir}/mysql + # Check if the scripts directory exists at all. - if [ ! -d ${db_scripts_dir}/mysql ]; then - log_error "Invalid scripts directory: ${db_scripts_dir}/mysql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find ${db_scripts_dir}/mysql/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir} -name 'upgrade*.sh' -type f | wc -l) + if [ "${num_files}" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "${num_files}" -eq 0 ]; then - log_error "No scripts in ${db_scripts_dir}/mysql?" + log_error "No scripts in ${upgrade_scripts_dir}?" exit 1 fi - for script in "${db_scripts_dir}"/mysql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do version=$(mysql_version) if [ "${version}" = "${target_version}" ] @@ -1344,7 +1358,7 @@ mysql_lease4_dump_test() { "${output_file}.tmp" \ "/tmp/$(basename "${output_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1373,7 +1387,7 @@ insert into lease4 values(12,22,NULL,40,(SELECT FROM_UNIXTIME(1643212345)),50,1, # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump mysql -4 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -1381,8 +1395,9 @@ insert into lease4 values(12,22,NULL,40,(SELECT FROM_UNIXTIME(1643212345)),50,1, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff ${ref_file} ${output_file})" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database mysql_wipe @@ -1407,7 +1422,7 @@ mysql_lease6_dump_test() { "${output_file}.tmp" \ "/tmp/$(basename "${output_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1435,7 +1450,7 @@ insert into lease6 values('::12',22,30,(SELECT FROM_UNIXTIME(1643212345)),40,50, # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump mysql -6 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -1443,8 +1458,9 @@ insert into lease6 values('::12',22,30,(SELECT FROM_UNIXTIME(1643212345)),40,50, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff ${ref_file} ${output_file})" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database mysql_wipe @@ -1457,7 +1473,14 @@ mysql_lease4_upload_test() { test_start "mysql.lease4_upload_test${1-}" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. mysql_wipe @@ -1470,7 +1493,7 @@ mysql_lease4_upload_test() { "${output_file}.tmp" \ "/tmp/$(basename "${input_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1487,14 +1510,14 @@ mysql_lease4_upload_test() { run_command \ "${kea_admin}" lease-upload mysql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -4 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump mysql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1502,8 +1525,13 @@ mysql_lease4_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff ${input_file} ${output_file})" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. mysql_wipe @@ -1516,7 +1544,14 @@ mysql_lease6_upload_test() { test_start "mysql.lease6_upload_test${1-}" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. mysql_wipe @@ -1529,7 +1564,7 @@ mysql_lease6_upload_test() { "${output_file}.tmp" \ "/tmp/$(basename "${input_file}").tmp" \ ; do - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${i}" else rm -f "${i}" @@ -1546,14 +1581,14 @@ mysql_lease6_upload_test() { run_command \ "${kea_admin}" lease-upload mysql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -6 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump mysql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1561,8 +1596,13 @@ mysql_lease6_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff ${input_file} ${output_file})" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. mysql_wipe @@ -2359,8 +2399,8 @@ mysql_lease4_upload_test mysql_lease4_upload_test -y mysql_lease6_upload_test mysql_lease6_upload_test -y -mysql_lease6_stat_test mysql_lease4_stat_test +mysql_lease6_stat_test mysql_lease_stat_upgrade_test mysql_lease_stat_recount_test mysql_unused_subnet_id_test diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index fb776e668e7987527693c40fb75da5f58ada59dc..54d8d6c2850421d984b06deb82964f1f607588b5 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -761,7 +761,7 @@ pgsql_upgrade_12_to_13_test() { } pgsql_upgrade_test() { - test_start "pgsql.upgrade-test" + test_start "pgsql.upgrade" # Wipe the whole database pgsql_wipe @@ -844,7 +844,7 @@ pgsql_lease4_dump_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${output_file}" touch "${output_file}.tmp" else @@ -875,7 +875,7 @@ insert into lease4 values(12,E'\\\\x3232','',40,TO_TIMESTAMP(1643212345),50,'t', # Dump lease4 to output_file run_command \ "${kea_admin}" lease-dump pgsql -4 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -883,8 +883,9 @@ insert into lease4 values(12,E'\\\\x3232','',40,TO_TIMESTAMP(1643212345),50,'t', cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff "${ref_file}" "${output_file}")" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database pgsql_wipe @@ -917,7 +918,7 @@ pgsql_lease6_dump_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${output_file}" touch "${output_file}.tmp" else @@ -948,7 +949,7 @@ insert into lease6 values('::12',E'\\\\x3232',30,TO_TIMESTAMP(1643212345),40,50, # Dump lease6 to output_file run_command \ "${kea_admin}" lease-dump pgsql -6 -u "${db_user}" -p "${db_password}" -n "${db_name}" \ - -d "${db_scripts_dir}" -o "${output_file}" "${@}" + -d "${db_scripts_dir}" -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the dump output to reference file, they should be identical @@ -956,8 +957,9 @@ insert into lease6 values('::12',E'\\\\x3232',30,TO_TIMESTAMP(1643212345),40,50, cmp -s "${output_file}" "${ref_file}" assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d, diff:\n$(diff "${ref_file}" "${output_file}")" - # Remove the output file. + # Remove the files. rm -f "${output_file}" + rm -f "${output_file}.tmp" # Let's wipe the whole database pgsql_wipe @@ -970,7 +972,14 @@ pgsql_lease4_upload_test() { test_start "pgsql.lease4_upload_test" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease4_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. pgsql_wipe @@ -978,7 +987,7 @@ pgsql_lease4_upload_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${input_file}.tmp" touch "${output_file}" touch "${output_file}.tmp" @@ -998,14 +1007,14 @@ pgsql_lease4_upload_test() { run_command \ "${kea_admin}" lease-upload pgsql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -4 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump pgsql -4 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1013,8 +1022,13 @@ pgsql_lease4_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff "${input_file}" "${output_file}")" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. pgsql_wipe @@ -1026,7 +1040,14 @@ pgsql_lease6_upload_test() { test_start "pgsql.lease6_upload_test" input_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" - output_file="@abs_top_srcdir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + input_file_cp="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.reference.csv" + output_file="@abs_top_builddir@/src/bin/admin/tests/data/lease6_dump_test.output.csv" + + if [ "${input_file}" != "${input_file_cp}" ]; then + cp -f ${input_file} ${input_file_cp} + input_file=${input_file_cp} + input_file_cp="" + fi # Wipe the whole database. pgsql_wipe @@ -1034,7 +1055,7 @@ pgsql_lease6_upload_test() { # Clean up any test files left from prior failed runs unless -y was provided in which case # explicitly create the file to check that it will be automatically deleted. # files should be removed by kea-admin itself. - if printf '%s' "${@}" | grep 'y' > /dev/null; then + if printf '%s' "$@" | grep 'y' > /dev/null; then touch "${input_file}.tmp" touch "${output_file}" touch "${output_file}.tmp" @@ -1054,14 +1075,14 @@ pgsql_lease6_upload_test() { run_command \ "${kea_admin}" lease-upload pgsql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -i "${input_file}" "${@}" + -i "${input_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-upload -6 failed, expected exit code %d, actual %d" # Dump leases. run_command \ "${kea_admin}" lease-dump pgsql -6 -u "${db_user}" \ -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" \ - -o "${output_file}" "${@}" + -o "${output_file}" "$@" assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, expected exit code %d, actual %d" # Compare the initial file used for upload to the file retrieved from dump, they should be identical. @@ -1069,8 +1090,13 @@ pgsql_lease6_upload_test() { cmp -s "${input_file}" "${output_file}" assert_eq 0 "${EXIT_CODE}" "file resulted from dump after upload does not match file used for upload, expected exit code %d, actual %d, diff:\n$(diff "${input_file}" "${output_file}")" - # Remove the output file. + # Remove the files. + if [ "${input_file}" != "${input_file_cp}" ]; then + rm -f "${input_file}" + fi + rm -f "${input_file}.tmp" rm -f "${output_file}" + rm -f "${output_file}.tmp" # Wipe the whole database. pgsql_wipe @@ -1083,16 +1109,31 @@ pgsql_lease6_upload_test() { pgsql_upgrade_schema_to_version() { target_version=$1 + upgrade_scripts_dir=${db_scripts_dir}/pgsql + # Check if the scripts directory exists at all. - if [ ! -d ${db_scripts_dir}/pgsql ]; then - log_error "Invalid scripts directory: ${db_scripts_dir}/pgsql" + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" exit 1 fi # Check if there are any files in it - num_files=$(find ${db_scripts_dir}/pgsql/upgrade*.sh -type f | wc -l) + num_files=$(find ${upgrade_scripts_dir} -name 'upgrade*.sh' -type f | wc -l) + if [ "${num_files}" -eq 0 ]; then + upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql + + # Check if the scripts directory exists at all. + if [ ! -d ${upgrade_scripts_dir} ]; then + log_error "Invalid scripts directory: ${upgrade_scripts_dir}" + exit 1 + fi + + # Check if there are any files in it + num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l) + fi + if [ "${num_files}" -eq 0 ]; then - log_error "No scripts in ${db_scripts_dir}/pgsql?" + log_error "No scripts in ${upgrade_scripts_dir}?" exit 1 fi @@ -1100,7 +1141,7 @@ pgsql_upgrade_schema_to_version() { # thru an env export PGPASSWORD=$db_password - for script in "${db_scripts_dir}"/pgsql/upgrade*.sh + for script in "${upgrade_scripts_dir}"/upgrade*.sh do version=$(pgsql_version) if [ "${version}" = "${target_version}" ] diff --git a/src/bin/agent/ca_process.cc b/src/bin/agent/ca_process.cc index 8c47377a781c3d747d235e131addf1459f5956a8..1fad8db9b4e6f919b88328e38654299cf3c1ba85 100644 --- a/src/bin/agent/ca_process.cc +++ b/src/bin/agent/ca_process.cc @@ -197,7 +197,7 @@ void CtrlAgentProcess::garbageCollectListeners(size_t leaving) { // We expect only one active listener. If there are more (most likely 2), // it means we have just reconfigured the server and need to shut down all - // listeners execept the most recently added. + // listeners except the most recently added. if (http_listeners_.size() > leaving) { // Stop no longer used listeners. for (auto l = http_listeners_.begin(); diff --git a/src/bin/agent/tests/Makefile.am b/src/bin/agent/tests/Makefile.am index 7cfedfeb111d1e04bbce784125704a42f5b10ac6..9c279d71c865aedfcd8c9b34e6dacf2fc8fc108d 100644 --- a/src/bin/agent/tests/Makefile.am +++ b/src/bin/agent/tests/Makefile.am @@ -6,8 +6,7 @@ EXTRA_DIST += testdata/hiddenp EXTRA_DIST += testdata/hiddens EXTRA_DIST += testdata/hiddenu -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = ca_process_tests.sh diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am index 0da992b6ec1efb4641eba4890efa91cee755c1f1..09ef42efedd90c8c7981cf8894a858d7cec783e0 100644 --- a/src/bin/d2/tests/Makefile.am +++ b/src/bin/d2/tests/Makefile.am @@ -5,8 +5,7 @@ EXTRA_DIST = EXTRA_DIST += testdata/d2_cfg_tests.json EXTRA_DIST += testdata/get_config.json -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = d2_process_tests.sh diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am index 8e5808bee5e62b1355f8e6d69f5f315ea27286b1..9b662d7c406f2d417e50e4aeacdf32f7cd7f7ce9 100644 --- a/src/bin/dhcp4/tests/Makefile.am +++ b/src/bin/dhcp4/tests/Makefile.am @@ -3,8 +3,7 @@ SUBDIRS = . # Add to the tarball: EXTRA_DIST = get_config_unittest.cc.skel -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp4_process_tests.sh diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 4e5f05f44b51da2af8da68613fb6f0830ddab3b0..44f312823165fd6e57e317c7fff5f55f5eb2d27a 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -5,12 +5,14 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include -#include #include #include #include #include +#include +#include +#include #include #include #include @@ -25,9 +27,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -36,16 +35,27 @@ #include #include #include + +#ifdef HAVE_MYSQL +#include +#endif + +#ifdef HAVE_PGSQL +#include +#endif + #include #include #include -#include +#include #include +#include using namespace std; using namespace isc; +using namespace isc::db::test; using namespace isc::dhcp; using namespace isc::data; using namespace isc::asiolink; @@ -2772,6 +2782,22 @@ Dhcpv4SrvTest::portsServerPort() { EXPECT_EQ(srv.server_port_, offer->getLocalPort()); } +/// @brief Remove TLS parameters from configuration element. +void removeTlsParameters(ConstElementPtr elem) { + if (elem) { + ElementPtr mutable_elem = boost::const_pointer_cast(elem); + std::vector tls_parameters= { + "trust-anchor", + "cert-file", + "key-file", + "cipher-list" + }; + for (auto const& parameter : tls_parameters) { + mutable_elem->remove(parameter); + } + } +} + void Dhcpv4SrvTest::loadConfigFile(const string& path) { CfgMgr::instance().clear(); @@ -2816,6 +2842,15 @@ Dhcpv4SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp4); ElementPtr mutable_config = boost::const_pointer_cast(dhcp4); mutable_config->set(string("hooks-libraries"), Element::createList()); + // Remove TLS parameters + ConstElementPtr hosts = dhcp4->get("hosts-database"); + removeTlsParameters(hosts); + hosts = dhcp4->get("hosts-databases"); + if (hosts) { + for (auto& host : hosts->listValue()) { + removeTlsParameters(host); + } + } ASSERT_NO_THROW(Dhcpv4SrvTest::configure(dhcp4->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -2836,8 +2871,38 @@ Dhcpv4SrvTest::loadConfigFile(const string& path) { HostMgr::setIOService(IOServicePtr()); } +/// @brief Class which handles initialization of database +/// backend for testing configurations. +class DBInitializer { + public: + /// @brief Constructor. + /// + /// Created database schema. + DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::createMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::createPgSQLSchema(); +#endif + } + + /// @brief Destructor. + /// + /// Destroys database schema. + ~DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::destroyMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::destroyPgSQLSchema(); +#endif + } +}; + void Dhcpv4SrvTest::checkConfigFiles() { + DBInitializer dbi; IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { @@ -2928,7 +2993,7 @@ TEST_F(Dhcpv4SrvTest, portsServerPort) { portsServerPort(); } -TEST_F(Dhcpv4SrvTest, portsServerPortMultiTHreading) { +TEST_F(Dhcpv4SrvTest, portsServerPortMultiThreading) { Dhcpv4SrvMTTestGuard guard(*this, true); portsServerPort(); } diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index e3518f1ad42999965370fc54b34355969d8d6567..3970fd9eaf7f486a6b4c11614284a540145995da 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -3,8 +3,7 @@ SUBDIRS = . # Add to the tarball: EXTRA_DIST = get_config_unittest.cc.skel -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Shell tests SHTESTS = dhcp6_process_tests.sh diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 6026aec818471032f82a5164125f7d1a14672a46..82f20b7dc7d8efdd71eecb109f004ae03b2818d5 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -10,6 +10,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -27,26 +31,33 @@ #include #include #include -#include +#include +#include #include #include #include -#include -#include -#include -#include + +#ifdef HAVE_MYSQL +#include +#endif + +#ifdef HAVE_PGSQL +#include +#endif #include #include -#include -#include + #include #include #include + #include +#include using namespace isc; using namespace isc::asiolink; +using namespace isc::db::test; using namespace isc::cb; using namespace isc::config; using namespace isc::data; @@ -156,6 +167,22 @@ namespace isc { namespace dhcp { namespace test { +/// @brief Remove TLS parameters from configuration element. +void removeTlsParameters(ConstElementPtr elem) { + if (elem) { + ElementPtr mutable_elem = boost::const_pointer_cast(elem); + std::vector tls_parameters= { + "trust-anchor", + "cert-file", + "key-file", + "cipher-list" + }; + for (auto const& parameter : tls_parameters) { + mutable_elem->remove(parameter); + } + } +} + void Dhcpv6SrvTest::loadConfigFile(const string& path) { CfgMgr::instance().clear(); @@ -200,6 +227,15 @@ Dhcpv6SrvTest::loadConfigFile(const string& path) { ASSERT_TRUE(dhcp6); ElementPtr mutable_config = boost::const_pointer_cast(dhcp6); mutable_config->set(string("hooks-libraries"), Element::createList()); + // Remove TLS parameters + ConstElementPtr hosts = dhcp6->get("hosts-database"); + removeTlsParameters(hosts); + hosts = dhcp6->get("hosts-databases"); + if (hosts) { + for (auto& host : hosts->listValue()) { + removeTlsParameters(host); + } + } ASSERT_NO_THROW(Dhcpv6SrvTest::configure(dhcp6->str(), true, true, true, true)); LeaseMgrFactory::destroy(); @@ -220,8 +256,38 @@ Dhcpv6SrvTest::loadConfigFile(const string& path) { HostMgr::setIOService(IOServicePtr()); } +/// @brief Class which handles initialization of database +/// backend for testing configurations. +class DBInitializer { + public: + /// @brief Constructor. + /// + /// Created database schema. + DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::createMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::createPgSQLSchema(); +#endif + } + + /// @brief Destructor. + /// + /// Destroys database schema. + ~DBInitializer() { +#if defined (HAVE_MYSQL) + db::test::destroyMySQLSchema(); +#endif +#if defined (HAVE_PGSQL) + db::test::destroyPgSQLSchema(); +#endif + } +}; + void Dhcpv6SrvTest::checkConfigFiles() { + DBInitializer dbi; IfaceMgrTestConfig test_config(true); string path = CFG_EXAMPLES; vector examples = { diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am index e85392d056993da98d1894a0d697df2ceb51c445..aee58bdebb6a39175fe6c1a7d82e374eef0ffb34 100644 --- a/src/bin/keactrl/Makefile.am +++ b/src/bin/keactrl/Makefile.am @@ -3,8 +3,11 @@ SUBDIRS = . tests # Install keactrl in sbin and the keactrl.conf required by the keactrl # in etc. keactrl will look for its configuration file in the etc folder. sbin_SCRIPTS = keactrl -KEA_CONFIGFILES = kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf \ - kea-ctrl-agent.conf +KEA_CONFIGFILES = kea-dhcp4.conf +KEA_CONFIGFILES += kea-dhcp6.conf +KEA_CONFIGFILES += kea-dhcp-ddns.conf +KEA_CONFIGFILES += kea-ctrl-agent.conf + if HAVE_SYSREPO KEA_CONFIGFILES += kea-netconf.conf endif @@ -13,9 +16,13 @@ CONFIGFILES = keactrl.conf $(KEA_CONFIGFILES) DISTCLEANFILES = keactrl keactrl.conf CLEANFILES = $(KEA_CONFIGFILES) -EXTRA_DIST = keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \ - kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \ - kea-ctrl-agent.conf.pre kea-netconf.conf.pre +EXTRA_DIST = keactrl.in +EXTRA_DIST += keactrl.conf.in +EXTRA_DIST += kea-dhcp4.conf.pre +EXTRA_DIST += kea-dhcp6.conf.pre +EXTRA_DIST += kea-dhcp-ddns.conf.pre +EXTRA_DIST += kea-ctrl-agent.conf.pre +EXTRA_DIST += kea-netconf.conf.pre # *.conf files are not really sources used for building other targets, but we need # these files to be generated before make install is called. @@ -24,23 +31,23 @@ BUILT_SOURCES = $(KEA_CONFIGFILES) kea-dhcp4.conf: kea-dhcp4.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@ kea-dhcp6.conf: kea-dhcp6.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@ kea-dhcp-ddns.conf: kea-dhcp-ddns.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@ kea-ctrl-agent.conf: kea-ctrl-agent.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@ kea-netconf.conf: kea-netconf.conf.pre $(top_builddir)/tools/path_replacer.sh \ - $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@ + $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@ if INSTALL_CONFIGURATIONS diff --git a/src/bin/lfc/tests/Makefile.am b/src/bin/lfc/tests/Makefile.am index 65593436c0292f2c39e862a391ac2580b78e233a..e2d31f65cb284a9515b5e45f7d97c1cebe317808 100644 --- a/src/bin/lfc/tests/Makefile.am +++ b/src/bin/lfc/tests/Makefile.am @@ -14,8 +14,7 @@ if USE_STATIC_LINK AM_LDFLAGS = -static endif -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/netconf/tests/Makefile.am b/src/bin/netconf/tests/Makefile.am index e25e62a3b73f1f834930138a8c047f869cbbf275..e736f848a4dda8e1737a79ad1e0b4944867eddb5 100644 --- a/src/bin/netconf/tests/Makefile.am +++ b/src/bin/netconf/tests/Makefile.am @@ -23,8 +23,7 @@ if USE_STATIC_LINK AM_LDFLAGS = -static endif -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/bin/perfdhcp/tests/Makefile.am b/src/bin/perfdhcp/tests/Makefile.am index 72202a8c4f80b1db47675487bce2be54bf6003c1..5c47ef68e379c2244a64315a4e8061ebfa981a44 100644 --- a/src/bin/perfdhcp/tests/Makefile.am +++ b/src/bin/perfdhcp/tests/Makefile.am @@ -16,8 +16,7 @@ CLEANFILES = *.gcno *.gcda # unit tests and have to be removed. CLEANFILES += test1.hex test2.hex test3.hex test4.hex test5.hex -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/bootp/tests/Makefile.am b/src/hooks/dhcp/bootp/tests/Makefile.am index 692a647ae2973b8ba4c32c7ea93499b529dc5219..311c6fa5d60a8b090db1f8d756781b983d6c01f3 100644 --- a/src/hooks/dhcp/bootp/tests/Makefile.am +++ b/src/hooks/dhcp/bootp/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/flex_option/libloadtests/Makefile.am b/src/hooks/dhcp/flex_option/libloadtests/Makefile.am index 9730bee9affcd81b8adad95d84a63cdf8eb13bee..8b23b0b0c6ea6bfeefbfb29bd7d1c16bf9a162ae 100644 --- a/src/hooks/dhcp/flex_option/libloadtests/Makefile.am +++ b/src/hooks/dhcp/flex_option/libloadtests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/flex_option/tests/Makefile.am b/src/hooks/dhcp/flex_option/tests/Makefile.am index 8051e8de7f57feeb9b1ca8b6e5d5b99a5d46f885..508912598d6726dbf78ec81e97e21b6c880e9d58 100644 --- a/src/hooks/dhcp/flex_option/tests/Makefile.am +++ b/src/hooks/dhcp/flex_option/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/high_availability/libloadtests/Makefile.am b/src/hooks/dhcp/high_availability/libloadtests/Makefile.am index 7387d710e51ec03ebb8b1a6ac67a4d1d534ff035..a80c7fab3f9bba3245de2409eb7faefd1206e09e 100644 --- a/src/hooks/dhcp/high_availability/libloadtests/Makefile.am +++ b/src/hooks/dhcp/high_availability/libloadtests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/high_availability/tests/Makefile.am b/src/hooks/dhcp/high_availability/tests/Makefile.am index ab3f8e38e8660efa72b8ca46fd1e33ded799917d..838a6946c2db5761777662a787c86f3b0d20c014 100644 --- a/src/hooks/dhcp/high_availability/tests/Makefile.am +++ b/src/hooks/dhcp/high_availability/tests/Makefile.am @@ -21,8 +21,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/lease_cmds/tests/Makefile.am b/src/hooks/dhcp/lease_cmds/tests/Makefile.am index 8b2efcc27f0152e236728cbe697de5c6b6bdb2b1..f8ab706e4e4a148ec9f1468e2fd71f75cea7db74 100644 --- a/src/hooks/dhcp/lease_cmds/tests/Makefile.am +++ b/src/hooks/dhcp/lease_cmds/tests/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/mysql_cb/tests/Makefile.am b/src/hooks/dhcp/mysql_cb/tests/Makefile.am index 49d519e815eff2baeaafc14e8b3b358b8b279503..e45f37feede1edb914ce6107a2e511852e98929c 100644 --- a/src/hooks/dhcp/mysql_cb/tests/Makefile.am +++ b/src/hooks/dhcp/mysql_cb/tests/Makefile.am @@ -16,8 +16,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/pgsql_cb/tests/Makefile.am b/src/hooks/dhcp/pgsql_cb/tests/Makefile.am index 146885d2b66c4eb9dfc8d137d3781e4bc7996359..81341543c8f9127fd2273e209156d5f2b3e6ace3 100644 --- a/src/hooks/dhcp/pgsql_cb/tests/Makefile.am +++ b/src/hooks/dhcp/pgsql_cb/tests/Makefile.am @@ -16,8 +16,7 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/hooks/dhcp/run_script/libloadtests/Makefile.am b/src/hooks/dhcp/run_script/libloadtests/Makefile.am index 439045af15aca44cef04379a2e371fb86da81ad5..97fd7bb78f2b7bbb1a362f6f2da80b9783f6c4b3 100644 --- a/src/hooks/dhcp/run_script/libloadtests/Makefile.am +++ b/src/hooks/dhcp/run_script/libloadtests/Makefile.am @@ -18,7 +18,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/run_script/tests/Makefile.am b/src/hooks/dhcp/run_script/tests/Makefile.am index acff08d54ddcba4c012863577383447164c0fb4a..730e4a029ca4bf8685146ccacb01a94ed17deb97 100644 --- a/src/hooks/dhcp/run_script/tests/Makefile.am +++ b/src/hooks/dhcp/run_script/tests/Makefile.am @@ -25,7 +25,8 @@ CLEANFILES = *.gcno *.gcda DISTCLEANFILES = run_script_test.sh -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/stat_cmds/tests/Makefile.am b/src/hooks/dhcp/stat_cmds/tests/Makefile.am index a0116ae4d8fa32a3414ad8088cf4bd89ae2b8e09..5dfb8e0c0f3c9dd7ecfe94f5f5184bf716ad3d24 100644 --- a/src/hooks/dhcp/stat_cmds/tests/Makefile.am +++ b/src/hooks/dhcp/stat_cmds/tests/Makefile.am @@ -24,7 +24,8 @@ EXTRA_DIST = CLEANFILES = *.gcno *.gcda -# TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + LOG_COMPILER = $(LIBTOOL) AM_LOG_FLAGS = --mode=execute diff --git a/src/hooks/dhcp/user_chk/tests/Makefile.am b/src/hooks/dhcp/user_chk/tests/Makefile.am index 36ad55c7d8a3f9dc0278aba6dc1eb6099fdeaf72..c37c28ee792cdac8bf72b4987bbd69efc1905c5f 100644 --- a/src/hooks/dhcp/user_chk/tests/Makefile.am +++ b/src/hooks/dhcp/user_chk/tests/Makefile.am @@ -20,8 +20,7 @@ EXTRA_DIST = test_users_1.txt test_users_err.txt CLEANFILES = *.gcno *.gcda DISTCLEANFILES = test_data_files_config.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/asiodns/tests/Makefile.am b/src/lib/asiodns/tests/Makefile.am index 09ff27ef75c87f4159e6a94c87e9c85525f616bd..74517c10ea739ae9e14f2d98c3e6eaff4eb69b54 100644 --- a/src/lib/asiodns/tests/Makefile.am +++ b/src/lib/asiodns/tests/Makefile.am @@ -9,8 +9,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/asiolink/tests/Makefile.am b/src/lib/asiolink/tests/Makefile.am index a402e92267a1a18cbe978d2d5e85b18065118ba9..b4be99784fd225e7130d88997c7fa679563a372b 100644 --- a/src/lib/asiolink/tests/Makefile.am +++ b/src/lib/asiolink/tests/Makefile.am @@ -17,8 +17,7 @@ DISTCLEANFILES = process_spawn_app.sh noinst_SCRIPTS = process_spawn_app.sh -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cc/tests/Makefile.am b/src/lib/cc/tests/Makefile.am index 2abfb8c328ac7a73cd8a5869846d1b21aa902491..c1e0a6b0a1fdb68d963009fe03f33e3a86eda6c9 100644 --- a/src/lib/cc/tests/Makefile.am +++ b/src/lib/cc/tests/Makefile.am @@ -8,8 +8,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cfgrpt/tests/Makefile.am b/src/lib/cfgrpt/tests/Makefile.am index 408dbadbe7c0cee59df0221f5d0672a753ef8ecb..cda5ed9bf2a8fcd1313144f7df62f43e87163b03 100644 --- a/src/lib/cfgrpt/tests/Makefile.am +++ b/src/lib/cfgrpt/tests/Makefile.am @@ -10,8 +10,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/config/tests/Makefile.am b/src/lib/config/tests/Makefile.am index b58dada343c3419a39159d2a161814a67e7ee705..8b4fdd82cc55bc46296149ab486953458442763d 100644 --- a/src/lib/config/tests/Makefile.am +++ b/src/lib/config/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda DISTCLEANFILES = data_def_unittests_config.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/config_backend/tests/Makefile.am b/src/lib/config_backend/tests/Makefile.am index 9e254b5959748df5e61be0911176bd034be585b7..a58d14394285ba4a79c07c33d84261365023bf1b 100644 --- a/src/lib/config_backend/tests/Makefile.am +++ b/src/lib/config_backend/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/cryptolink/tests/Makefile.am b/src/lib/cryptolink/tests/Makefile.am index a18618e5ae9c8142e2352f09f46db4d439f951eb..a8bbb47123659c8fe4a09dec680afa386aaed08b 100644 --- a/src/lib/cryptolink/tests/Makefile.am +++ b/src/lib/cryptolink/tests/Makefile.am @@ -10,8 +10,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/d2srv/tests/Makefile.am b/src/lib/d2srv/tests/Makefile.am index 436cb21ee1479f6dddff3121ccc3ea7731620bd3..b1fffe820d4520b6fd2f4bc5900271de3f607915 100644 --- a/src/lib/d2srv/tests/Makefile.am +++ b/src/lib/d2srv/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/database/tests/Makefile.am b/src/lib/database/tests/Makefile.am index dd39beef932fed0f6e9d381353250aaf9d733714..f4cf4f0d3e5ed56dfc9f8c7827f775d5ad3af217 100644 --- a/src/lib/database/tests/Makefile.am +++ b/src/lib/database/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcp/tests/Makefile.am b/src/lib/dhcp/tests/Makefile.am index 33d74f2529c4e75e6d08c89742e8325c80081373..a140fc0a126384134c3d3594a77c7c2cbefd46bb 100644 --- a/src/lib/dhcp/tests/Makefile.am +++ b/src/lib/dhcp/tests/Makefile.am @@ -13,8 +13,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcp_ddns/tests/Makefile.am b/src/lib/dhcp_ddns/tests/Makefile.am index e1f27d1fa24d2aa201ba6685ad355a1f81b48486..c504ca977059b86a774be428d7ff15c191f38b75 100644 --- a/src/lib/dhcp_ddns/tests/Makefile.am +++ b/src/lib/dhcp_ddns/tests/Makefile.am @@ -13,8 +13,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am index 804a497a732f0a7499a0dc7314a925410b761e10..495fef6f73c7c3e5756f85a3b03f34d0a2f1931f 100644 --- a/src/lib/dhcpsrv/tests/Makefile.am +++ b/src/lib/dhcpsrv/tests/Makefile.am @@ -16,8 +16,7 @@ endif CLEANFILES = *.gcno *.gcda DISTCLEANFILES = test_libraries.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc index 9383db8b63583f8827bbb778efb5309080e237d7..0b4f839abf47ff4cfa3f9428a904d9052b3f1592 100644 --- a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1073,6 +1074,25 @@ TEST_F(MySqlLeaseMgrTest, leaseStatsQueryAttribution6MultiThreading) { testLeaseStatsQueryAttribution6(); } +/// @brief This test is a basic check for the generic backend test class, +/// rather than any production code check. +TEST_F(MySqlGenericBackendTest, leaseCount) { + + // Create database connection parameter list + DatabaseConnection::ParameterMap params; + params["name"] = "keatest"; + params["user"] = "keatest"; + params["password"] = "keatest"; + + // Create and open the database connection + MySqlConnection conn(params); + conn.openDatabase(); + + // Check that the countRows is working. It's used extensively in other + // tests, so basic check is enough here. + EXPECT_EQ(0, countRows(conn, "lease4")); +} + /// @brief Checks that no exceptions are thrown when inquiring about JSON /// support and prints an informative message. TEST_F(MySqlLeaseMgrTest, isJsonSupported) { diff --git a/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc b/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc index ace663e7b7f03dbe9488ce625caded941b145457..ac142d0c6fc59cb7acf5488758291b16a33160bd 100644 --- a/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc +++ b/src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.cc @@ -6,8 +6,10 @@ #include #include +#include using namespace isc::db; +using namespace isc::db::test; namespace isc { namespace dhcp { @@ -15,6 +17,7 @@ namespace test { MySqlGenericBackendTest::MySqlGenericBackendTest() : GenericBackendTest() { + createMySQLSchema(); } size_t diff --git a/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc b/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc index 412ff0486e69f796ae8af4c02c8673858cb85b6f..8d588a1049dedb42e3f8992e33c966b60888f528 100644 --- a/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc +++ b/src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc @@ -6,8 +6,10 @@ #include #include +#include using namespace isc::db; +using namespace isc::db::test; namespace isc { namespace dhcp { @@ -15,6 +17,7 @@ namespace test { PgSqlGenericBackendTest::PgSqlGenericBackendTest() : GenericBackendTest() { + createPgSQLSchema(); } size_t diff --git a/src/lib/dns/tests/Makefile.am b/src/lib/dns/tests/Makefile.am index 9b2e0fadc3656ec2d1904432f7e650127831cdb5..bf0ab4195de8652c93dfb24b48c64b92791719da 100644 --- a/src/lib/dns/tests/Makefile.am +++ b/src/lib/dns/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/eval/tests/Makefile.am b/src/lib/eval/tests/Makefile.am index f9d5a9e5a5a434eccc0e943713c6293cb6cc8aef..5a33f32e3fa7dec572f91a71cc447bb4feb8c4f3 100644 --- a/src/lib/eval/tests/Makefile.am +++ b/src/lib/eval/tests/Makefile.am @@ -12,8 +12,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/exceptions/tests/Makefile.am b/src/lib/exceptions/tests/Makefile.am index 0e4d2293d5e280a9ef6155465acf377ac4797d49..5df69bd825b1037a3976af2082600b285ef2654f 100644 --- a/src/lib/exceptions/tests/Makefile.am +++ b/src/lib/exceptions/tests/Makefile.am @@ -7,8 +7,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/hooks/tests/Makefile.am b/src/lib/hooks/tests/Makefile.am index b6fe8b9a8f03424149ff4d0c9b63eab5f1eed3c0..f0f5b048f5375b478d55b5d6ef8f0d773536788a 100644 --- a/src/lib/hooks/tests/Makefile.am +++ b/src/lib/hooks/tests/Makefile.am @@ -19,8 +19,7 @@ CLEANFILES = *.gcno *.gcda $(builddir)/marker_file.dat # Files generated by configure DISTCLEANFILES = marker_file.h test_libraries.h -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST @@ -38,8 +37,8 @@ if HAVE_GTEST # to unexpected errors. For this reason, the --enable-static-link option is # ignored for unit tests built here. -noinst_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \ - liblecl.la libucl.la libfcl.la libpcl.la libacl.la +noinst_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la +noinst_LTLIBRARIES += liblecl.la libucl.la libfcl.la libpcl.la libacl.la # -rpath /nowhere is a hack to trigger libtool to not create a # convenience archive, resulting in shared modules diff --git a/src/lib/http/tests/Makefile.am b/src/lib/http/tests/Makefile.am index c440fad5cdce8c65f11f440664e53d2dbb5082b3..51647db60210316822d0dccefe321053d78ab8b7 100644 --- a/src/lib/http/tests/Makefile.am +++ b/src/lib/http/tests/Makefile.am @@ -21,8 +21,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/log/interprocess/tests/Makefile.am b/src/lib/log/interprocess/tests/Makefile.am index 5a53327338c6f2a29bcc17663392a0e7f5023769..a51a4b34a630cfa791e6e02787cd65ed165aa11f 100644 --- a/src/lib/log/interprocess/tests/Makefile.am +++ b/src/lib/log/interprocess/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/log/tests/Makefile.am b/src/lib/log/tests/Makefile.am index 145d8093e53b03fde8e06f521ef8252a74d0255f..668c3671d8de31b14190902c81dfdf7786239716 100644 --- a/src/lib/log/tests/Makefile.am +++ b/src/lib/log/tests/Makefile.am @@ -80,8 +80,7 @@ noinst_SCRIPTS = $(SHTESTS) if HAVE_GTEST -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) # Set of unit tests for the general logging classes PROGRAM_TESTS = run_unittests diff --git a/src/lib/mysql/tests/Makefile.am b/src/lib/mysql/tests/Makefile.am index f11254e3c7a3aad189c7a1d230bbb706b9b4b4ae..b0945f298f33a01ca758c65ded26620db387aaba 100644 --- a/src/lib/mysql/tests/Makefile.am +++ b/src/lib/mysql/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/mysql/testutils/Makefile.am b/src/lib/mysql/testutils/Makefile.am index 64680e639f9958e6f496d513d4001b00abede2df..b4c2349b49ea6c15b429b21cb19265145612dbaa 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 936beb74aa75dea34d191d99635d2123a73387c0..fd4f8b15342280588a53ab5959678b07e2bd39b5 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 a3df21fe38da0c14938ae7a9ba0103f915b5f362..9178bc59ba122da851cda39f2a9eac9a7a12f3f8 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/tests/Makefile.am b/src/lib/pgsql/tests/Makefile.am index ac24adbf24db8b3901514f8b08b7cb62a8047883..1250a52d030d39bb7a6c25b2bbab01b736d2cb0a 100644 --- a/src/lib/pgsql/tests/Makefile.am +++ b/src/lib/pgsql/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/pgsql/testutils/Makefile.am b/src/lib/pgsql/testutils/Makefile.am index c46de152e46be4a3d32df7a398abec65f31dcb36..195f981658a43691fe83924bcf6cb78a2f14e45f 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 05226d5907f917723cdb8f942a192b898b9a9e86..1cf79a5cc6eb8c7cb47e5171673bd8a357e3ca08 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 5eada318de3af0bba945aa3e891cca46a321da88..5919670a591a8877991fabb6fb6898a00ee5e473 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 diff --git a/src/lib/process/tests/Makefile.am b/src/lib/process/tests/Makefile.am index 4d016456e9757d7d92ea37a554a437a1f4ef70aa..7c1a43059a640f496bf6dfc23a66711d2a2c154b 100644 --- a/src/lib/process/tests/Makefile.am +++ b/src/lib/process/tests/Makefile.am @@ -14,8 +14,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/util/tests/Makefile.am b/src/lib/util/tests/Makefile.am index 56aff6a664203d7168b24b1615bd6eb8bac83f9d..8b6a612e75b0003694e1f8f68f937b8fd09c5b14 100644 --- a/src/lib/util/tests/Makefile.am +++ b/src/lib/util/tests/Makefile.am @@ -17,8 +17,7 @@ CLEANFILES = *.gcno *.gcda # CSV files are created by unit tests for CSVFile class. CLEANFILES += *.csv -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/lib/yang/tests/Makefile.am b/src/lib/yang/tests/Makefile.am index 9fe769326a3b4c6571e10d4845501959f67b8a38..09c42d7ef5a45a6032735fb7da9a14a047addaab 100644 --- a/src/lib/yang/tests/Makefile.am +++ b/src/lib/yang/tests/Makefile.am @@ -11,8 +11,7 @@ endif CLEANFILES = *.gcno *.gcda -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) TESTS = if HAVE_GTEST diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql index c4b0bdc170a1daa3694bab908ddc310abd82adfb..7eeb7cb47b9e4da978afce90567145d5c9f74df2 100644 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@ -146,7 +146,8 @@ INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID'); # Hardware address extracted from docsis options INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS'); -UPDATE schema_version SET version='2', minor='0'; +UPDATE schema_version +SET version = '2', minor = '0'; # This line concludes database upgrade to version 2.0. diff --git a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in index efbc2c8876d0dde348df7f62c055b656594de707..1e1608966fbf83a25d58052587d42ad4d039c119 100644 --- a/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi @@ -53,5 +53,6 @@ INSERT INTO lease_hwaddr_source VALUES (16, 'HWADDR_SOURCE_REMOTE_ID'); INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID'); INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS'); -UPDATE schema_version SET version='2', minor='0'; +UPDATE schema_version +SET version = '2', minor = '0'; EOF diff --git a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in index 78af24afb1d8eedb6345be3634e92ff841e8bf87..a6c1f2e234f719d128787e8f0ea765fa99925a5f 100644 --- a/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi @@ -114,5 +114,6 @@ END $$ DELIMITER ; -UPDATE schema_version SET version='3', minor='0'; +UPDATE schema_version +SET version = '3', minor = '0'; EOF diff --git a/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in b/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in index 3affd3af17605192b4a8ed67ea4a2d519184fdf1..10cc7ff7d8448ba5eb23229fe1c8606a6bc574d0 100644 --- a/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in b/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in index 65a57ed0be171b44863b540db3200c2a2b0319b3..34b81cbcdd8abc31fb9e53a14605947b6020f13e 100644 --- a/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in b/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in index cfe3489b31341a4c8f926cc3555859506315e5b1..607fc03f3e23962c5a149e6fff3e1f43606e2f99 100644 --- a/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in b/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in index 45f40b99e12f4028aa05ec435bd6d66b12f265b7..d129a72bb0da7e32717187a67fda128e9cbad3eb 100644 --- a/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in b/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in index 498787890ba892f7cde932c92f32c80d7eabd5f0..415995c56755e8632449bad9cd24c87324c9c0d0 100644 --- a/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in b/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in index 63392c868b83e76b050af3bcdd7ffc7dd46815ff..43a8e871a01302f824ec078bf8b1233e03591894 100644 --- a/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in b/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in index 5d83da5866435ab0ad5d0b823055b86b6ab8d8bd..4d1a2f7d3751f4bd7d0db296b916f5aacab71a1a 100644 --- a/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in b/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in index bba08bc7dc59e426799a6736f466be140d4c850f..6d6c52a425790c87eb09e8fecc45e870752044cf 100644 --- a/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in b/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in index f2c3e4989e57a5d80b59364cd98574dbd0af39ce..e4e5fb3ae66948b3b071b3c3652e64860154ab23 100644 --- a/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in b/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in index 4ad298e98eeaf9ffd59e68352efe8f634d9e272e..d3243e31b822ce4886bab4d7d1e65d187d8d3944 100644 --- a/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in @@ -22,8 +22,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in b/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in index fdbf17dda473ad07728c91d6109d0202286e2333..c0d6ebf22500f76dea77c52145a85b47fe15576d 100644 --- a/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in b/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in index 473a18f5e2ab031e5444bd0b5e0fc1c3ae625a32..86a220348341472fa83eab781bb5f9fe45aa8007 100644 --- a/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in b/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in index 3b8cd34bf2932eb3add0563642b638bb5b6fff9b..ef9d0c29d290b49797621056da3acf8cfc039c67 100644 --- a/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in b/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in index 76e8608ac7006eb1e83786eb6fd225a908535fa0..eb76089ce675e3a0305d43205d4d0b6f43530dea 100644 --- a/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in b/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in index 69b3f65e34199e2685e9e37abd8267f061aeaa76..bd05fbe3af18f5678575e397c6cacc0a705491d2 100644 --- a/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in b/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in index ebf3117f8068236080f6a75484a417ce0894a86e..c02e10cf32e529d5ad3712108d57a236baeb5f76 100644 --- a/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in b/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in index 717730b40bfcc17396767c3dfb60fb89c52d04b2..a99a46d61d837786c21766dca5cd2ca0bf6a7ac9 100644 --- a/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in b/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in index 1b01cad822ab883fa94f5f81043d0933b6d6fe26..9e33e8b7f8c4c27613e13d0a4d327ca5882b35fe 100644 --- a/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in b/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in index c5f512abb3e6609fc46bbc4322c320d15ebb8b76..3d3e599925360297ae77e34da9cf48d15f7a872e 100644 --- a/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in +++ b/src/share/database/scripts/mysql/upgrade_010_to_011.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in b/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in index c4142b2a171e9b4dc31e75edb9c302a35e448e66..5b73e9a1c1b5156b2987e4dc57414fe04045d105 100644 --- a/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in +++ b/src/share/database/scripts/mysql/upgrade_011_to_012.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in b/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in index ee133d59285678d4022447533cfbc67aaa2e5ffd..09e0cfc8f6d0cbaaea410fb2c68ec38cd1cc8eb1 100644 --- a/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in +++ b/src/share/database/scripts/mysql/upgrade_012_to_013.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in b/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in index b442ef3bfe1937354df368d129ba786f89cebde0..82c3ff51384830fef4855da1863393ef054cb049 100644 --- a/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in +++ b/src/share/database/scripts/mysql/upgrade_013_to_014.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/mysql/wipe_data.sh.in b/src/share/database/scripts/mysql/wipe_data.sh.in index 83a6f3f8c0d3e2cd712b461c08f7f81fc951773e..a31ca37745f0cd37af8996cb1b7b6743114efef6 100644 --- a/src/share/database/scripts/mysql/wipe_data.sh.in +++ b/src/share/database/scripts/mysql/wipe_data.sh.in @@ -25,8 +25,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in b/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in index 658c92e632f27a8192bd24819143779b02f6bd9c..1a7378a51c08308e8048e2d2096d0f15aa7ff190 100644 --- a/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in b/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in index bf793530bc9aa8844a7afa609aa313ee699437c8..6683c39095bb46fdf4064ca770c81ae706978ec8 100644 --- a/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in b/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in index d5013cdd7a14dfe0e90b67896157445d46f803bb..48a8e1be512a707f6eaa824a5a4ce9f60834440d 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in b/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in index f9ec2bb9d82710d1297c6cc47e9d099c8d1fc78a..79ba6501e9d7429894c1e071bae185a683ebe6ca 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in b/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in index 6933c16f50ca932db1bef98ceebbd85cfc004d3e..c39e59397351a367311008d7fa20a5b74babae3a 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in b/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in index d7a0885280efd8fdd1246d99337d5f2f369dd3f4..200e8937e67c3b620c6d58f7c69b31948a3c8d50 100644 --- a/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in b/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in index 62c861d5f3a61fd21222624936a94aa185c83b32..be62005d8bcb2f47fd3b2a02e0c82b136321ca6d 100644 --- a/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in b/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in index bd3f5d16099efedd178ec7d5fba54ef041810ec8..c99a417864d17e10fb44592790c13984fedc1030 100644 --- a/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in b/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in index b1bf2d3793d4732b02acf7e7ad114853063988c8..f66520b3e7b0bf6b8555af37c9bbdb6b97162869 100644 --- a/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in b/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in index b036c529f8af9c3400ef7008d142d1409e727f21..260196d360d0ef32efd2de1b03ee9470bdfe0286 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in b/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in index 76bb8cd32cfd7827cf6a44afb72783258a1eb9de..38149a30cd6486fc7d50792ec30a2da70b77e01a 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in b/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in index 0feeb0ae0d005a7d2e933064f56d98f567c0ac64..a2065b2739aa82b6860d670046116fc3bb452801 100644 --- a/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in b/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in index fe186522a68c35c6fb02495bb0196b1cac2430f4..f101dbdaa33e3cb8c67232a9c35ca0701ad9a60a 100644 --- a/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in b/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in index b68ebf6bf77da38c534c6db9be71fbb5162eb348..64df2c3b9917c7a670cfc3aebb845433e0140906 100644 --- a/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in b/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in index 4c66c427ad5e1ef12dd764fd067a8ca1d9e2c213..cc8ff00f1683ed83fd79bc2058cd71e82182d35a 100644 --- a/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in b/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in index 625265749c12d2724b05272f1b0d6a3bb46e9b35..7c35387a4d1f271b7fe7a8e762363858f0fe81ea 100644 --- a/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in b/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in index 00a02dcea2e18dc3f408d63c78cb5124b1f7078e..e7ab2c316eca1f8672769570900917976a199e40 100644 --- a/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in b/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in index bb45b9e732b6eb65cb2acb43777453651eee3dd5..8b6cb1d351d0c394bf2a3b623fe873190caa974e 100644 --- a/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in @@ -19,8 +19,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi diff --git a/src/share/database/scripts/pgsql/wipe_data.sh.in b/src/share/database/scripts/pgsql/wipe_data.sh.in index 088b802e249d55690837b00a62f08bca687e2331..c19339cb0909ced8a68d95527a1ce199b1cfeb04 100644 --- a/src/share/database/scripts/pgsql/wipe_data.sh.in +++ b/src/share/database/scripts/pgsql/wipe_data.sh.in @@ -25,8 +25,8 @@ prefix="@prefix@" # Include utilities. Use installed version if available and # use build version if it isn't. -if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then - . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" +if [ -e "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" ]; then + . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh" else . "@abs_top_builddir@/src/bin/admin/admin-utils.sh" fi