Commit 7e9fb87b authored by Likun Zhang's avatar Likun Zhang
Browse files

Add the code for module xfrin.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1235 e5f2f494-b856-4b98-b285-d166d9295462
parent 14bd0667
......@@ -152,6 +152,7 @@ AC_CONFIG_FILES([Makefile
src/bin/loadzone/Makefile
src/bin/msgq/Makefile
src/bin/auth/Makefile
src/bin/xfrin/Makefile
src/lib/Makefile
src/lib/cc/Makefile
src/lib/python/Makefile
......@@ -170,6 +171,9 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cmdctl/cmdctl.py
src/bin/cmdctl/run_b10-cmdctl.sh
src/bin/cmdctl/unittest/cmdctl_test
src/bin/xfrin/unittest/xfrin_test
src/bin/xfrin/xfrin.py
src/bin/xfrin/run_b10-xfrin.sh
src/bin/bind10/bind10.py
src/bin/bind10/tests/bind10_test
src/bin/bind10/run_bind10.sh
......@@ -187,8 +191,10 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/lib/dns/tests/testdata/gen-wiredata.py
], [
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
chmod +x src/bin/bind10/run_bind10.sh
chmod +x src/bin/cmdctl/unittest/cmdctl_test
chmod +x src/bin/xfrin/unittest/xfrin_test
chmod +x src/bin/bindctl/unittest/bindctl_test
chmod +x src/bin/bindctl/bindctl
chmod +x src/bin/loadzone/run_loadzone
......
......@@ -276,6 +276,20 @@ class BoB:
if self.verbose:
sys.stdout.write("Started b10-auth (PID %d)\n" % auth.pid)
# start the b10-xfrin
if self.verbose:
sys.stdout.write("Starting b10-xfrin\n")
try:
xfrind = ProcessInfo("b10-xfrin", ['b10-xfrin'])
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
auth.process.kill()
return "Unable to start b10-xfrin; " + str(e)
self.processes[xfrind.pid] = xfrind
if self.verbose:
sys.stdout.write("Started b10-xfrin (PID %d)\n" % xfrind.pid)
# start the b10-cmdctl
# XXX: we hardcode port 8080
if self.verbose:
......@@ -286,6 +300,7 @@ class BoB:
c_channel.process.kill()
bind_cfgd.process.kill()
auth.process.kill()
xfrind.process.kill()
return "Unable to start b10-cmdctl; " + str(e)
self.processes[cmd_ctrld.pid] = cmd_ctrld
if self.verbose:
......
#! /bin/sh
PYTHON_EXEC=${PYTHON_EXEC:-@PYTHON@}
export PYTHON_EXEC
BINDCTL_TEST_PATH=@abs_top_srcdir@/src/bin/xfrin/unittest
PYTHONPATH=@abs_top_srcdir@/src/bin/xfrin
export PYTHONPATH
cd ${BINDCTL_TEST_PATH}
exec ${PYTHON_EXEC} -O xfrin_test.py $*
# Copyright (C) 2009 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.
import unittest
import socket
from xfrin import *
# Rewrite the class for unittest.
class MyXfrin(Xfrin):
def __init__(self):
pass
class TestXfrin(unittest.TestCase):
def test_parse_cmd_params(self):
xfr = MyXfrin()
args = {}
args['zone_name'] = 'sd.cn.'
args['port'] = '12345'
args['master'] = '218.241.108.122'
name, master, port, db_file = xfr._parse_cmd_params(args)
self.assertEqual(port, 12345)
self.assertEqual(name, 'sd.cn.')
self.assertEqual(master, '218.241.108.122')
self.assertEqual(db_file, '/tmp/zone.sqlite3')
if __name__== "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment