summaryrefslogtreecommitdiffstats
path: root/contrib/dlz/modules/mysqldyn/testing
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dlz/modules/mysqldyn/testing')
-rw-r--r--contrib/dlz/modules/mysqldyn/testing/README11
-rw-r--r--contrib/dlz/modules/mysqldyn/testing/dlz.data18
-rw-r--r--contrib/dlz/modules/mysqldyn/testing/dlz.schema31
-rw-r--r--contrib/dlz/modules/mysqldyn/testing/named.conf39
4 files changed, 99 insertions, 0 deletions
diff --git a/contrib/dlz/modules/mysqldyn/testing/README b/contrib/dlz/modules/mysqldyn/testing/README
new file mode 100644
index 0000000..862ec6f
--- /dev/null
+++ b/contrib/dlz/modules/mysqldyn/testing/README
@@ -0,0 +1,11 @@
+These files were used for testing on Ubuntu Linux using MySQL
+
+To set up a test server:
+- Install MySQL: sudo apt-get install mysql-server
+- Run "mysql --user=USER --password=PASSWORD < dlz.schema" to set up database
+- Run "mysql --user=USER --password=PASSWORD < dlz.data" to populate it
+- Update named.conf with correct USER and PASSWORD
+- Generate a TSIG key: "ddns-confgen -qz example.com"
+
+To query the database, use "dig -p 5300 @localhost"
+To send dynamic updates, use "nsupdate -p 5300 -k ddns.key"
diff --git a/contrib/dlz/modules/mysqldyn/testing/dlz.data b/contrib/dlz/modules/mysqldyn/testing/dlz.data
new file mode 100644
index 0000000..068ad7a
--- /dev/null
+++ b/contrib/dlz/modules/mysqldyn/testing/dlz.data
@@ -0,0 +1,18 @@
+use BindDB;
+insert into `Zones`
+ ( `id`, `domain`, `host`, `admin`, `serial`, `expire`,
+ `refresh`, `retry`, `minimum`, `ttl`, `writeable`) VALUES
+ (1, 'example.com', '@', 'info', 2014040100, 10800,
+ 7200, 604800, 86400, 86400, 1);
+
+insert into `ZoneData`
+ (`id`, `zone_id`, `name`, `type`, `data`) VALUES
+ ('', 1, '@', 'NS', 'ns1.example.com.'),
+ ('', 1, '@', 'NS', 'ns2.example.com.'),
+ ('', 1, '@', 'MX', '10 mail.example.com.'),
+ ('', 1, '@', 'A', '192.168.0.2'),
+ ('', 1, '@', 'TXT', '"v=spf1 ip:192.168.0.3 ~all"'),
+ ('', 1, 'www', 'CNAME', 'example.com.'),
+ ('', 1, 'mail', 'A', '192.168.0.3'),
+ ('', 1, 'ns1', 'A', '192.168.1.111'),
+ ('', 1, 'ns2', 'A', '192.168.1.222');
diff --git a/contrib/dlz/modules/mysqldyn/testing/dlz.schema b/contrib/dlz/modules/mysqldyn/testing/dlz.schema
new file mode 100644
index 0000000..a28f912
--- /dev/null
+++ b/contrib/dlz/modules/mysqldyn/testing/dlz.schema
@@ -0,0 +1,31 @@
+CREATE DATABASE `BindDB` DEFAULT CHARACTER SET latin1;
+USE `BindDB`;
+
+CREATE TABLE `ZoneData` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `zone_id` int(11) NOT NULL,
+ `name` varchar(128) NOT NULL DEFAULT '',
+ `type` varchar(16) NOT NULL DEFAULT '',
+ `data` varchar(128) NOT NULL DEFAULT '',
+ `ttl` int(11) NOT NULL DEFAULT '86400',
+ PRIMARY KEY (`id`),
+ KEY `zone_idx` (`zone_id`),
+ KEY `name_idx` (`zone_id`, `name`),
+ KEY `type_idx` (`type`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE `Zones` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `domain` varchar(128) NOT NULL DEFAULT '',
+ `host` varchar(128) NOT NULL DEFAULT '',
+ `admin` varchar(128) NOT NULL DEFAULT '',
+ `serial` int(11) NOT NULL DEFAULT '1',
+ `expire` int(11) NOT NULL DEFAULT '86400',
+ `refresh` int(11) NOT NULL DEFAULT '86400',
+ `retry` int(11) NOT NULL DEFAULT '86400',
+ `minimum` int(11) NOT NULL DEFAULT '86400',
+ `ttl` int(11) NOT NULL DEFAULT '86400',
+ `writeable` tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `domain_idx` (`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/contrib/dlz/modules/mysqldyn/testing/named.conf b/contrib/dlz/modules/mysqldyn/testing/named.conf
new file mode 100644
index 0000000..8131d9c
--- /dev/null
+++ b/contrib/dlz/modules/mysqldyn/testing/named.conf
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+controls { };
+
+options {
+ directory ".";
+ port 5300;
+ pid-file "named.pid";
+ session-keyfile "session.key";
+ listen-on { any; };
+ listen-on-v6 { none; };
+ recursion no;
+};
+
+include "ddns.key";
+
+key rndc_key {
+ secret "1234abcd8765";
+ algorithm hmac-md5;
+};
+
+controls {
+ inet 127.0.0.1 port 9953 allow { any; } keys { rndc_key; };
+};
+
+dlz "test" {
+ database "dlopen ../dlz_mysqldyn_mod.so BindDB localhost root password";
+};