]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3599] Unit tests framework added.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 5 Nov 2014 12:17:28 +0000 (13:17 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 5 Nov 2014 12:17:28 +0000 (13:17 +0100)
configure.ac
src/bin/Makefile.am
src/bin/admin/Makefile.am [new file with mode: 0644]
src/bin/admin/kea-admin.in
src/bin/admin/scripts/Makefile.am [new file with mode: 0644]
src/bin/admin/scripts/mysql/Makefile.am [new file with mode: 0644]
src/bin/admin/scripts/pgsql/Makefile.am [new file with mode: 0644]
src/bin/admin/tests/memfile_tests.sh.in [new file with mode: 0644]
src/bin/admin/tests/mysql_tests.sh.in [new file with mode: 0644]
src/lib/dhcpsrv/Makefile.am

index 1abe766fbc8f362cb8a9f26e798293c7ca0eea4b..a53835034700e5acc6da9d7a4adc9972ea730454 100644 (file)
@@ -1393,6 +1393,14 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  src/bin/perfdhcp/Makefile
                  src/bin/perfdhcp/tests/Makefile
                  src/bin/perfdhcp/tests/testdata/Makefile
+                 src/bin/admin/Makefile
+                 src/bin/admin/kea-admin
+                 src/bin/admin/scripts/Makefile
+                 src/bin/admin/tests/Makefile
+                 src/bin/admin/tests/memfile_tests.sh
+                 src/bin/admin/tests/mysql_tests.sh
+                 src/bin/admin/scripts/mysql/Makefile
+                 src/bin/admin/scripts/pgsql/Makefile
                  src/hooks/Makefile
                  src/hooks/dhcp/Makefile
                  src/hooks/dhcp/user_chk/Makefile
index a3c5e1561017dcdef239ffebdf1f70e57bf073ea..372b59b4a00aac3f9a953d6527580e525ea96cc4 100644 (file)
@@ -1,5 +1,5 @@
 # The following build order must be maintained.
-SUBDIRS = dhcp4 dhcp6 d2 perfdhcp
+SUBDIRS = dhcp4 dhcp6 d2 perfdhcp admin
 
 if CONFIG_BACKEND_JSON
 SUBDIRS += keactrl
diff --git a/src/bin/admin/Makefile.am b/src/bin/admin/Makefile.am
new file mode 100644 (file)
index 0000000..563a363
--- /dev/null
@@ -0,0 +1,21 @@
+SUBDIRS = . scripts tests
+
+# Install kea-admin in sbin.
+sbin_SCRIPTS  = kea-admin
+
+man_MANS = kea-admin.8
+DISTCLEANFILES = $(man_MANS)
+EXTRA_DIST = $(man_MANS) admin-utils.sh
+
+if GENERATE_DOCS
+
+kea-admin.8: kea-admin.xml
+       @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(builddir)/kea-admin.xml
+
+else
+
+$(man_MANS):
+       @echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+       @echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild Kea > $@
+
+endif
index 7c3622e81bea04b1ad37fd1de87417a772613545..bd1f2449b02234b813f24f8d1ec72c74c0584130 100644 (file)
@@ -22,6 +22,7 @@
 
 
 # Get the location of the kea-admin scripts
+prefix=@prefix@
 SCRIPTS_DIR_DEFAULT=@datarootdir@/@PACKAGE@/scripts
 scripts_dir=${SCRIPTS_DIR_DEFAULT}
 
diff --git a/src/bin/admin/scripts/Makefile.am b/src/bin/admin/scripts/Makefile.am
new file mode 100644 (file)
index 0000000..6602983
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = mysql pgsql
diff --git a/src/bin/admin/scripts/mysql/Makefile.am b/src/bin/admin/scripts/mysql/Makefile.am
new file mode 100644 (file)
index 0000000..37c412c
--- /dev/null
@@ -0,0 +1,6 @@
+SUBDIRS = .
+
+EXTRA_DIST = dhcpdb_create.mysql upgrade_1.0_to_2.0.sh
+
+dist_pkgdata_DATA = $(EXTRA_DIR)
+
diff --git a/src/bin/admin/scripts/pgsql/Makefile.am b/src/bin/admin/scripts/pgsql/Makefile.am
new file mode 100644 (file)
index 0000000..8eb08ab
--- /dev/null
@@ -0,0 +1,5 @@
+SUBDIRS = .
+
+EXTRA_DIST = dhcpdb_create.pgsql
+
+dist_pkgdata_DATA = $(EXTRA_DIR)
diff --git a/src/bin/admin/tests/memfile_tests.sh.in b/src/bin/admin/tests/memfile_tests.sh.in
new file mode 100644 (file)
index 0000000..fff624f
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+# Include common test library.
+. @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh
+
+memfile_init_test() {
+    test_start "memfile.init"
+    
+    # @todo: Implement this (ticket #3601)
+
+    test_finish 0
+}
+
+memfile_version_test() {
+    test_start "memfile.version"
+    
+    # @todo: Implement this (ticket #3601)
+
+    test_finish 0
+}
+
+memfile_upgrade_test() {
+    test_start "memfile.upgrade"
+    
+    # @todo: Implement this (ticket #3601)
+
+    test_finish 0
+}
+
+memfile_init_test
+memfile_version_test
+memfile_upgrade_test
diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in
new file mode 100644 (file)
index 0000000..2a85e9c
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+# Include common test library.
+. @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh
+
+# If the code is installed, include admin-utils.sh from the destination
+# directory. If not, include it from the sources.
+prefix=@prefix@
+
+if [ -e @datarootdir@/admin-utils.sh ]; then
+    echo "INCLUDING FROM DESTDIR"
+    . @datarootdir@/admin-utils.sh
+else
+    echo "INCLUDING FROM BUILDDIR"
+    . @abs_top_builddir@/src/bin/admin/admin-utils.sh
+fi
+
+mysql_init_test() {
+    test_start "mysql.init"
+    
+    # @todo: Implement this
+
+    test_finish 0
+}
+
+mysql_version_test() {
+    test_start "mysql.version"
+    
+    # @todo: Implement this
+
+    test_finish 0
+}
+
+mysql_upgrade_test() {
+    test_start "mysql.upgrade"
+    
+    # @todo: Implement this
+
+    test_finish 0
+}
+
+mysql_init_test
+mysql_version_test
+mysql_upgrade_test
index 7502945b4b669f3c3d341ebdd5d3eece0c03bb76..a0d87372ec58b5376258868b8f091259b36b3049 100644 (file)
@@ -113,9 +113,9 @@ endif
 # The message file should be in the distribution
 EXTRA_DIST = dhcpsrv_messages.mes
 
-# Distribute MySQL schema creation script and backend documentation
-EXTRA_DIST += dhcpdb_create.mysql dhcpdb_create.pgsql database_backends.dox libdhcpsrv.dox
-dist_pkgdata_DATA = dhcpdb_create.mysql dhcpdb_create.pgsql
+# Distribute backend documentation
+# Database schema creation script moved to src/bin/admin
+EXTRA_DIST += database_backends.dox libdhcpsrv.dox
 
 install-data-local:
        $(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)