BIND 10 trac3140, updated. 6473f037f0b8d67ca53faad4339ae596e433ec97 [trac3140] add basic lettuce test for b10-dhcp4

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Aug 30 12:10:06 UTC 2013


The branch, trac3140 has been updated
       via  6473f037f0b8d67ca53faad4339ae596e433ec97 (commit)
      from  fd0ef5a296cab4d4d7417c3d3ce0110ec21bba06 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6473f037f0b8d67ca53faad4339ae596e433ec97
Author: Jeremy C. Reed <jreed at isc.org>
Date:   Fri Aug 30 05:08:38 2013 -0700

    [trac3140] add basic lettuce test for b10-dhcp4
    
    This allows an environment variable B10_DHCP4_PORT to set
    a testing port.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp4/main.cc                              |    8 +++++++-
 .../dhcp4_basic.config}                            |   12 ++----------
 tests/lettuce/features/dhcp.feature                |   19 +++++++++++++++++++
 tests/lettuce/setup_intree_bind10.sh.in            |    5 ++++-
 4 files changed, 32 insertions(+), 12 deletions(-)
 copy tests/lettuce/configurations/{resolver/resolver_basic.config.orig => dhcp/dhcp4_basic.config} (60%)
 create mode 100644 tests/lettuce/features/dhcp.feature

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc
index 45f1de1..6614ef7 100644
--- a/src/bin/dhcp4/main.cc
+++ b/src/bin/dhcp4/main.cc
@@ -53,8 +53,14 @@ usage() {
 int
 main(int argc, char* argv[]) {
     int ch;
-    int port_number = DHCP4_SERVER_PORT; // The default. any other values are
+    int port_number;
+    if (getenv("B10_DHCP4_PORT")) {
+        port_number = boost::lexical_cast<uint16_t>(getenv("B10_DHCP4_PORT"));
+    } else {
+        port_number = DHCP4_SERVER_PORT; // The default. any other values are
                                          // useful for testing only.
+    }
+
     bool stand_alone = false;  // Should be connect to BIND10 msgq?
     bool verbose_mode = false; // Should server be verbose?
 
diff --git a/tests/lettuce/configurations/dhcp/dhcp4_basic.config b/tests/lettuce/configurations/dhcp/dhcp4_basic.config
new file mode 100644
index 0000000..4765788
--- /dev/null
+++ b/tests/lettuce/configurations/dhcp/dhcp4_basic.config
@@ -0,0 +1,23 @@
+{
+    "version": 3,
+    "Logging": {
+        "loggers": [ {
+            "severity": "DEBUG",
+            "name": "*",
+            "debuglevel": 99
+        } ]
+    },
+    "Dhcp4": {
+    },
+    "Init": {
+        "components": {
+            "b10-dhcp4": {
+                "kind": "needed"
+            },
+            "b10-cmdctl": {
+                "kind": "needed",
+                "special": "cmdctl"
+            }
+        }
+    }
+}
diff --git a/tests/lettuce/features/dhcp.feature b/tests/lettuce/features/dhcp.feature
new file mode 100644
index 0000000..9573b95
--- /dev/null
+++ b/tests/lettuce/features/dhcp.feature
@@ -0,0 +1,19 @@
+Feature: Basic DHCP
+    This feature set is just testing the execution of the b10-dhcp4
+    component. It sees whether it starts up and takes a configuration.
+
+    Scenario: Start Dhcp4
+        # This scenario starts a server that runs Dhcp4.
+        When I start bind10 with configuration dhcp/dhcp4_basic.config
+        And wait for bind10 stderr message BIND10_STARTED_CC
+        And wait for bind10 stderr message CMDCTL_STARTED
+        And wait for bind10 stderr message DHCP4_CCSESSION_STARTED
+        And wait for bind10 stderr message DHCP4_DB_BACKEND_STARTED
+
+        bind10 module Dhcp4 should be running
+        And bind10 module Auth should not be running
+        And bind10 module Xfrout should not be running
+        And bind10 module Zonemgr should not be running
+        And bind10 module Xfrin should not be running
+        And bind10 module Stats should not be running
+        And bind10 module StatsHttpd should not be running
diff --git a/tests/lettuce/setup_intree_bind10.sh.in b/tests/lettuce/setup_intree_bind10.sh.in
index 600f5c4..5324528 100755
--- a/tests/lettuce/setup_intree_bind10.sh.in
+++ b/tests/lettuce/setup_intree_bind10.sh.in
@@ -20,7 +20,7 @@ export PYTHON_EXEC
 
 BIND10_PATH=@abs_top_builddir@/src/bin/bind10
 
-PATH=@abs_top_builddir@/src/bin/bind10:@abs_top_builddir@/src/bin/bindctl:@abs_top_builddir@/src/bin/msgq:@abs_top_builddir@/src/bin/auth:@abs_top_builddir@/src/bin/resolver:@abs_top_builddir@/src/bin/cfgmgr:@abs_top_builddir@/src/bin/cmdctl:@abs_top_builddir@/src/bin/stats:@abs_top_builddir@/src/bin/xfrin:@abs_top_builddir@/src/bin/xfrout:@abs_top_builddir@/src/bin/zonemgr:@abs_top_builddir@/src/bin/ddns:@abs_top_builddir@/src/bin/dhcp6:@abs_top_builddir@/src/bin/sockcreator:@abs_top_builddir@/src/bin/loadzone:$PATH
+PATH=@abs_top_builddir@/src/bin/bind10:@abs_top_builddir@/src/bin/bindctl:@abs_top_builddir@/src/bin/msgq:@abs_top_builddir@/src/bin/auth:@abs_top_builddir@/src/bin/resolver:@abs_top_builddir@/src/bin/cfgmgr:@abs_top_builddir@/src/bin/cmdctl:@abs_top_builddir@/src/bin/stats:@abs_top_builddir@/src/bin/xfrin:@abs_top_builddir@/src/bin/xfrout:@abs_top_builddir@/src/bin/zonemgr:@abs_top_builddir@/src/bin/ddns:@abs_top_builddir@/src/bin/dhcp4:@abs_top_builddir@/src/bin/dhcp6:@abs_top_builddir@/src/bin/sockcreator:@abs_top_builddir@/src/bin/loadzone:$PATH
 export PATH
 
 PYTHONPATH=@abs_top_builddir@/src/bin:@abs_top_builddir@/src/lib/python/isc/log_messages:@abs_top_builddir@/src/lib/python/isc/cc:@abs_top_builddir@/src/lib/python:@abs_top_builddir@/src/lib/dns/python/.libs:@abs_top_builddir@/src/lib/xfr/.libs:@abs_top_builddir@/src/lib/log/.libs:@abs_top_builddir@/src/lib/util/io/.libs:@abs_top_builddir@/src/lib/python/isc/config:@abs_top_builddir@/src/lib/python/isc/acl/.libs:@abs_top_builddir@/src/lib/python/isc/datasrc/.libs:$PYTHONPATH
@@ -50,4 +50,7 @@ export B10_FROM_BUILD
 BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
 export BIND10_MSGQ_SOCKET_FILE
 
+B10_DHCP4_PORT=47806
+export B10_DHCP4_PORT
+
 export LETTUCE_SETUP_COMPLETED=1



More information about the bind10-changes mailing list