BIND 10 trac648, updated. f73c46eb406d7234dd7519a1d330db67813b31ab Staging tests for testing command-channel commands.

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Mar 3 18:32:42 UTC 2011


The branch, trac648 has been updated
       via  f73c46eb406d7234dd7519a1d330db67813b31ab (commit)
      from  5cde27560e4b8e3cd098daae572ca4d0124358de (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 f73c46eb406d7234dd7519a1d330db67813b31ab
Author: Shane Kerr <shane at isc.org>
Date:   Thu Mar 3 19:31:53 2011 +0100

    Staging tests for testing command-channel commands.

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

Summary of changes:
 src/bin/bind10/tests/bind10_cmd_test.py |   47 +++++++++++++++++++++++++++++++
 src/bin/bind10/tests/bind10_test.in     |   32 ---------------------
 2 files changed, 47 insertions(+), 32 deletions(-)
 create mode 100644 src/bin/bind10/tests/bind10_cmd_test.py
 delete mode 100755 src/bin/bind10/tests/bind10_test.in

-----------------------------------------------------------------------
diff --git a/src/bin/bind10/tests/bind10_cmd_test.py b/src/bin/bind10/tests/bind10_cmd_test.py
new file mode 100644
index 0000000..0861def
--- /dev/null
+++ b/src/bin/bind10/tests/bind10_cmd_test.py
@@ -0,0 +1,47 @@
+"""
+This program checks the BIND 10 boss interaction.
+"""
+import unittest
+import subprocess
+import time
+import select
+import isc.cc
+
+BIND10_EXE="../run_bind10.sh"
+TIMEOUT=3
+
+class TestBossBindctl(unittest.TestCase):
+    def _waitForString(self, bob, s):
+        """Read the input from the Process object until we find the 
+        string we're looking for or we timeout."""
+        found_string = False
+        start_time = time.time()
+        while time.time() < start_time + TIMEOUT:
+            (r,w,x) = select.select((bob.stdout,), (), (), TIMEOUT) 
+            if bob.stdout in r:
+                s = bob.stdout.readline()
+                if s == '':
+                    break
+                if s.startswith(s): 
+                    found_string = True
+                    break
+        return found_string
+
+    def testBasicBindctl(self):
+        """Run basic bindctl"""
+        # start bind10
+        bob = subprocess.Popen(args=(BIND10_EXE,),
+                               stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        started_ok = self._waitForString(bob, '[bind10] BIND 10 started')
+
+        # connect to the command channel
+        self.cc = isc.cc.Session()
+
+        # shut down 
+        bob.terminate()
+        bob.wait()
+
+
+if __name__ == '__main__':
+    unittest.main()
+
diff --git a/src/bin/bind10/tests/bind10_test.in b/src/bin/bind10/tests/bind10_test.in
deleted file mode 100755
index cbd7452..0000000
--- a/src/bin/bind10/tests/bind10_test.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2010  Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM 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.
-
-PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
-export PYTHON_EXEC
-
-BIND10_PATH=@abs_top_srcdir@/src/bin/bind10
-
-PATH=@abs_top_srcdir@/src/bin/msgq:@abs_top_srcdir@/src/bin/auth:@abs_top_srcdir@/src/bin/bind-cfgd:$PATH
-export PATH
-
-PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_srcdir@/src/bin/bind10
-export PYTHONPATH
-
-cd ${BIND10_PATH}/tests
-${PYTHON_EXEC} -O bind10_test.py $*
-exec ${PYTHON_EXEC} -O args_test.py $*
-




More information about the bind10-changes mailing list