BIND 10 trac547, updated. be3ac2735e707deb384f9f3ec9f36857026bae1d Merge branch 'trac547' of ssh://bind10.isc.org/var/bind10/git/bind10 into trac547

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Mar 9 13:32:05 UTC 2011


The branch, trac547 has been updated
       via  be3ac2735e707deb384f9f3ec9f36857026bae1d (commit)
       via  9ba177c93b4c095cd73e853bc7a456d1de266f77 (commit)
       via  e476fa5a1ed96acf7c6cb37a87e9159db73b9d15 (commit)
       via  19165d4d1a1ff2baca41503076a90f28b26e3a46 (commit)
       via  71cc3a41a32b1e48f334c15a4cfbc8a1534d5a68 (commit)
       via  2fadb1f77d8f36fe357e166275d3174429432066 (commit)
       via  f4536b31c403f574b35a8b739f29c8a343dfb924 (commit)
       via  7099f7086e68e031656575e1de7e37408e6766f7 (commit)
       via  990bf36b0a780c2f553e6bfb743983fd8499f149 (commit)
       via  3fa544d227564dc078f016af73a379bf796b1a6f (commit)
       via  a5f612a097fef81219e69d35ca0541d249d766d9 (commit)
       via  5b50945c4cba20ea3c9d5614a9ffed4282a68dc9 (commit)
       via  64db0b4022effb361104b480aa8e18794c4b835a (commit)
       via  d5b92ece8d7e840698077715e193bba473c6001f (commit)
       via  d7a5431d2bb40fc92a3e5ab137dd30a08db76c01 (commit)
       via  fe969b6b25c0415f155e61a2695f5c21c9676b1a (commit)
       via  ddf3bfb5142ecbb8ab44b731ee70b7767e6f1e83 (commit)
       via  078d68e4d2ae9654bb63aafe664fdc24093a1b00 (commit)
       via  877553a8cdce7bf7e4360c41b111aa34d9a0dc06 (commit)
       via  911422aa5fe5fcbf5a564c164311f7a355833bb1 (commit)
       via  1ffd7904e1bee8890647969fd1ba717a3abd8ea7 (commit)
       via  07edaadf77a4916ec0104d2081c0d324a0a68750 (commit)
       via  bf176737e6f30f1614aa0fcc4ea427b38806c03d (commit)
       via  55ee2ba52f6711ddfbef04a100fcddbe7d4a0448 (commit)
       via  dd697e9017d3b9281d7a33337f61fda870e32bc9 (commit)
       via  aab21e054c2aae4b94079e31f7d8b3b51f5e80e6 (commit)
       via  5a708dfff4367b7061aa63a0d5fe4c4fea89ebb4 (commit)
       via  026883056f9385e9bd2b57ce65238eda84d9ae91 (commit)
       via  a1481573ac7f973aa38e2d29e70add8a7ec02064 (commit)
       via  cefd50684e81ce71b34a93b82246cabe4e041ad1 (commit)
       via  f66155bec008366c14ecfc36830ef77e63dc6a84 (commit)
       via  268952195f0ceca4dee149e707f489b1d47df6ed (commit)
       via  e9ecae2e1135573ca19a01804261ed0fef720a9a (commit)
       via  dfc8dab14d8e9e83c4cdfbbe0c1ccd3113dfe357 (commit)
       via  c0eb6840b2d9821fe1c511a60ce59c93ba02f539 (commit)
       via  e5c8140b36f74a2b0bc701b26c91f5cef0329b15 (commit)
       via  996ffdfc33495112a15a77ddf5cfbbd0073ed2c4 (commit)
       via  e3ae6739060ee490eb3a823100e5ce34a60a3536 (commit)
       via  7b1a63a5afb33f25cc78b3d09920d1cf71461760 (commit)
       via  6cdca232a666fa2a771de93fba218a80534f3bbd (commit)
       via  9377ed57cbcc547835a8d6e4d0705053d17ae0a2 (commit)
       via  6b6ccdc5173e7afe280166a1d04760c65aff662e (commit)
       via  8dbba8a494189a3b396d4d4dc9d3af4e41f4dd0f (commit)
       via  a116845deff6a945d30654168a2099fbca942aa3 (commit)
       via  97ee680029535189120ae72714e27fa382da47da (commit)
       via  168afd55aa4b523a7676210c90d38025c135255f (commit)
       via  e5265939da84a32fa1229663330671dfd8f26c87 (commit)
       via  109d5e271e436d6de6b688b6f101f17babb25bed (commit)
       via  35dab46a34d489eefb23845440829c9d7fcc1a59 (commit)
       via  a5a2774e0af4ab0c2ddf9de3c142097ae3fc4a24 (commit)
       via  ff7dc11b9a1a47c471b79b627e81e99685ca6ae2 (commit)
       via  0e28db3e9f0f340e41950acc4b971f87e3762465 (commit)
       via  8664af36a9650f7a119ad0f232745adf05bfeb62 (commit)
       via  096010ac1d8b8a0873e412b57cb91e4832dd51f9 (commit)
       via  30925222c3b190a3bc4ee5c7c4767185c11de5a9 (commit)
       via  06e1ea8ad3e4a6e454366e55b6f1216e76352767 (commit)
       via  57a331f019dbe7cfd81a4848b1f83c5355a9a577 (commit)
       via  66eb66159d75c4aecd30add2b58fbc3b56f9781a (commit)
       via  2e2a545038b320a1643a8406cef0211d4e72ce22 (commit)
       via  d145ff5ccf1446f86a37c52eb4dde9d0b79f907e (commit)
       via  5e9b1d526aa53e2b7fd6b5ceb14280f036ee1ca8 (commit)
       via  b4f0b370554e75f3248d92a9fb720ea0ffe9dff3 (commit)
       via  45a75048c318ffc817dc464dafdba3641220722a (commit)
       via  1241b73b471cea22e5b0a285d19dafe6d25643a2 (commit)
       via  a395c6989abade810481d5f3ab9b26d251ef49e9 (commit)
       via  3d78c648b44ed661585237ee1aab4e69731af191 (commit)
       via  d93ce6038bb8d770479e0200d6e9aa2b850f7990 (commit)
       via  a13cf5dee6d9a9f9a0c80d9e1a245df8015fd615 (commit)
       via  e5617c77c052fa5c3aaff564379bc6e051593eca (commit)
       via  09443bccf6fdd4589f7bb5f9c0697418533606ac (commit)
       via  610428e055bbba8a8abc71365393bb15a2980c6e (commit)
       via  3c95e8e0174e1eb1721d2dc7e451ab2816fe48e8 (commit)
       via  d0bb9911b264d8f08a5ea8a59a953c57029caaef (commit)
       via  d714a479c926f72b0a1d98d892e1056d5d5469ec (commit)
       via  fa47de86a37959ddaad7f47ac54fac20c8d785db (commit)
       via  9781a86080345cdb085dca2b667ca02a519b0c11 (commit)
       via  84a0c6b23fe609e1fb398ba8fb48897564d33368 (commit)
       via  13093acdffb42c77ca725e2eac88087b1f7c2bd7 (commit)
       via  38f98df2d10d48d76ae59b92e88fb117af99f856 (commit)
       via  a413ae557a06398e8289fc502bb028ffb7b89c81 (commit)
       via  c294d35340634a3a228e638c700d26c1fad565fe (commit)
       via  bb7424d215a4e29fee901b221dff2b13e9310f8f (commit)
       via  be666219db38d2a34bcdee16080b9fa04f5e515b (commit)
       via  42681186cce76bbffe616fd29400cf4d320bdc4b (commit)
       via  bcc4433b55302f8a62e8c86c4825cbe6b445f8aa (commit)
       via  6b7ad716ba77af5ca5dbe2b7852ccb3e5c2454c3 (commit)
       via  6372e1e1842f26ea3a70780c99a3ad4fdc35643f (commit)
       via  bc7a1c5a0aaf5c15ff8a793280d6e6a8e771a5dc (commit)
       via  01dae68a7cc5bf99792d2a3b515acf23bcbb5ae5 (commit)
       via  44d4cfb40e5a2138b53a94aa91da9783c73e3cb8 (commit)
       via  a5dbc1cb756861919a9f0cf5f71cd6efba4aafc8 (commit)
       via  921bc4963d2393af943ffd71d15c58426a8d0656 (commit)
       via  87853eeaa76546fc7dd933be4e87daac0fc7c321 (commit)
       via  c906185a749417281336655bd742a99b5b194200 (commit)
       via  a1c8f39df1b4d3767fcaf9d4b85e36fff863af04 (commit)
       via  83f2df7e1b7d8f8170f05816b94a9841c63152be (commit)
       via  2e1ec218f44c14716cd971c78547e8525d6ccac1 (commit)
       via  14d74270f32cd34532840b4748ea03e55337efe0 (commit)
       via  cf1429df42d50a74dea6c0ca11e1ee027f133e7f (commit)
       via  c95283504aeda27288e96adf25e777855595bac5 (commit)
       via  236b0928cb577cfa0ffa5f88d4da221d878284c5 (commit)
       via  96403e587e5664c88fbf29d9f370eb314a1e2b1d (commit)
       via  f6853e73cca16fa764d96caf211d5c35d091a475 (commit)
       via  12576cdc7ecf062e7b2e2c25771f267ae633a6cd (commit)
       via  f2b004871d34de08acbf3d972f1230ee4459d862 (commit)
       via  13ba665b40ca057c1c5cd4115315c7a1bf7b6f08 (commit)
       via  0e6ab01a553a5bc9b41419a9fe9ef2ba1a62a291 (commit)
       via  5339cde8a4faeccd40ec591eb39597d67ae98c7d (commit)
       via  9ad01a854a2f0653a9edd3ee9c449b441cac224a (commit)
       via  83aafa63f0ae68448a2a074052bf409d83850054 (commit)
       via  a894f43653ee7fa944d6bb9a6f52c4079091bd88 (commit)
       via  3ca08ffa87665a4a8fb0b0789884ae5141b2fab0 (commit)
       via  a6b8d7d481527fa31ddf1101039af1fad6fbd64e (commit)
       via  14ae71b676dd2f2054ad83dae36f1ffc0863dc36 (commit)
       via  ebf0005bffb32bd3f2f92ef75fe539c17ba60453 (commit)
       via  9f544262de4c048f98424094d89930f5d4a6dc63 (commit)
       via  f16f7cda3ad196d6e73594b1d366b5eec66668db (commit)
       via  b957606cfcf9dc0594478e5af7282aa430b79a65 (commit)
       via  dcd374777698b5778c9aee8c4326d41439087c5f (commit)
       via  5cfbe4f80fb6d8017f132191e8c56399646448e3 (commit)
       via  78fb6102ab1ad797e5c42f2d9bb023a43570eda9 (commit)
       via  d5adf676e2bd122bcd02d407aae0ca1b53548046 (commit)
       via  45d4cf8cda555bde75601166e21a78ede911cce0 (commit)
       via  99828ca78fc5ab04136fee237b15a1bfdc276183 (commit)
       via  bcde855c1138a395870f87efa54043b7e9e6dab2 (commit)
       via  d5e3048bca3d408acd30045a826a003f94e149f5 (commit)
       via  85dd690f9b3cf54c7750932a6ba03542ab6de4f2 (commit)
       via  e98133b50f1bf84e9b483e20533686fd8365023f (commit)
       via  c114768f7fd8d01aa3ce62e2cd087efcdb0937bd (commit)
       via  21bfbd09e9309380b6eb28e470ec2fd2d3ed39d8 (commit)
       via  20209730fb11c1a425fbfac1a0ee3391f2cca9b9 (commit)
       via  315d90575d5158fd949ccc65294cc9ee79305843 (commit)
       via  9d8aaf9f58ffac492ffaeafcc913f9417d77827c (commit)
       via  1a89dd69929bcb415f002e3320c274ffd8e07045 (commit)
       via  6d7cc79caae006682d116e1edb3d3c833459b489 (commit)
       via  27f96dceb36840f8ba73091b6312d3cf9ce2de22 (commit)
       via  c57c0b538bf329d316b7aeb1320e4e1debadde5d (commit)
       via  bd449d4c2ef348c6fb32556e7f072143d94869ff (commit)
       via  50361c232fc5e913eb1920ed02112179e897b86f (commit)
       via  baf91fc46b3a8881091ca05f849b365af21c3b49 (commit)
       via  2b891c98caa35d5f3d9715f36cfe9e31794f63e0 (commit)
       via  cf2017e93d1d4845c1d41b9d198c636a65706381 (commit)
       via  679a109130f63eb6a820473fb30426e3c17a6201 (commit)
       via  bc0485db91d2d79a8e8450ee8d49a4ac98d5c535 (commit)
       via  0a52986a0e0a5b3ca7925ae8e73bf3f8005c9131 (commit)
       via  f166f1608de3c48742ca8b682f30a9383bb64c46 (commit)
       via  cce0dcba32deb575e5c869dd487473bcfc138c6d (commit)
       via  a63bb5398e8479a3fe0ca5de7c344707203fe777 (commit)
       via  2221a46dbe11fb4bb0a016674e9cfdf8127767dc (commit)
       via  2527c49395978095a4f0b81554d3a221ecf8851c (commit)
       via  ec73d6a6a2d447677a702ba765d5521e1423ef94 (commit)
       via  ff7c29ea831f78c04707a663df44552963527f4b (commit)
       via  2efe389c60b01516bf1df57acb3146384d4a4364 (commit)
       via  555a272df462c52bf701ef589b18af2f1d30dc5a (commit)
       via  3b968fa370ddb96f3aaeaea5b62888f80ad095ee (commit)
       via  a9cb28f960c0c36f9e0fc466a9053752996f78f9 (commit)
       via  fa6e6f53c476a8fb02a8368ea5f656ea5219057f (commit)
       via  39be3c50d2624f7e72adfa509e4ca96f25ae2ed5 (commit)
       via  416fcf7eb6c7c0dc249bcc838d75504f070750a1 (commit)
       via  64978870d1b6843e94268160f5e9c7b7dfbeb755 (commit)
       via  241571157deb66f6766918b783379409e294e2f5 (commit)
       via  65a77d8fde64d464c75917a1ab9b6b3f02640ca6 (commit)
       via  0eefd8be74290fd9e72e3d25356c64b24c844816 (commit)
       via  2be9594e5c6cac0e01a75a06d8df31d8cef98380 (commit)
       via  17f4eab177a8d459024a5fcf2b43e6826c129891 (commit)
       via  de2d7124bd8a6bf3f2c0a6e661dc5b6b178765cc (commit)
       via  71bcc9a5c413276bd90276c24ee28d59478a138e (commit)
       via  6ac000df85625f5921e8895a1aafff5e4be3ba9c (commit)
       via  7fef6a88c5ab2cedc5f2fa0003ae1beb7a380b9c (commit)
       via  b0c4e1599b68046bbd72455ce90433285b226ffe (commit)
       via  56f0f77fe500b6cb41cda2a950b4349f0778561e (commit)
       via  e49c4b5a038981cea80bf81613efa2c538c8b3e0 (commit)
       via  5222b51a047d8f2352bc9f92fd022baf1681ed81 (commit)
       via  ccd3fea75828ec4e0e2b20d8bba1d7b103164141 (commit)
       via  a663b567f5a57c19c033de049219e4a5eb6d936b (commit)
       via  4cf5938f86b3c1a54beac417f6723505183ddf11 (commit)
       via  977a6a742c821ed49fc7d977f917b47f23563bdb (commit)
       via  137a6934a14cf0c5b5c065e910b8b364beb0973f (commit)
       via  bdc63200a7e2adcde2b0ce44aaeb8477fb059d17 (commit)
       via  058f40e75eb59aea1d3e18ffcdfdacc8386aafa3 (commit)
       via  e0d5584bdb3ca05b078693787c35d8f8f9228040 (commit)
       via  4596c143eadfb9d67c5395bb6fa367470976d0cb (commit)
       via  f3bd834c8e9334004994c33d0798ed6b61a7a99b (commit)
       via  860a2965d04f80fd0e90d3c5100332a8bb2ae9d8 (commit)
       via  c4f4d32eed0f4c26e4968336179a1e749e925aa7 (commit)
       via  26582526e20e56ea4547a447cfa93e122af0f0e1 (commit)
       via  6934390c92855d4006b727e1c8c1c89688afeb5f (commit)
       via  333edc6244dafdab42258b84a46237c6dcf936a0 (commit)
       via  8af2ccd45c7f070d2aa168763815fe8a82808e79 (commit)
       via  19f9f10fa5594bfe311688823fba5dd149e76a59 (commit)
       via  5851a6cc19356b49fcc2500f5d40e7861874561e (commit)
       via  8be2bf19228473f5d54f5015e893b44791a5c0c2 (commit)
       via  edfcbcaccbf4b8098f5cfc1bd1943fe4542b3306 (commit)
       via  7396247046ccc046d711265100aa8d46be057626 (commit)
       via  9c3f27137967b5f92c430baab6ab442258d9d692 (commit)
       via  56df4f9ab31b300b83c26fbeb1a7cf7951f8338e (commit)
       via  2298392e3ce9b5a470f4c0e3b2a22ba571f9b8ab (commit)
       via  309d02a51ee22ff4c0226784ecd7bb4394d19542 (commit)
       via  ddd7b7c3dfdebae68e3742e175e4931f0a5f6c5e (commit)
       via  a2609d0762b9dfdf2750a1bc44ea33525c634f5b (commit)
       via  de130e6d9b6dec3586126f660123a905cc9a284a (commit)
       via  53b5297513ee2320556dead019f268e79b49f77a (commit)
       via  a9211d7973042503353e61f0e16ea092c0f621bf (commit)
       via  48211526895ce56de771e65a7e6d23892c639660 (commit)
       via  ff55e63140852f4c7cf8a0404dde36442c45ff4a (commit)
       via  b723719cdad0da4db9b2099596c09f407dbdb135 (commit)
      from  0d63af8d4515315c188633d451ffbe886fac48e5 (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 be3ac2735e707deb384f9f3ec9f36857026bae1d
Merge: 9ba177c93b4c095cd73e853bc7a456d1de266f77 0d63af8d4515315c188633d451ffbe886fac48e5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 21:17:51 2011 +0900

    Merge branch 'trac547' of ssh://bind10.isc.org/var/bind10/git/bind10 into trac547
    
    Conflicts:
    	ChangeLog
    	src/bin/stats/Makefile.am
    	src/bin/stats/run_b10-stats.sh.in
    	src/bin/stats/tests/b10-stats-httpd_test.py
    	src/bin/stats/tests/stats_test.in

commit 9ba177c93b4c095cd73e853bc7a456d1de266f77
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 20:25:02 2011 +0900

    [trac547] remove ::1 from default setting

commit e476fa5a1ed96acf7c6cb37a87e9159db73b9d15
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:53:11 2011 +0900

    [trac547] add stats_httpd (fix conflicts)

commit 19165d4d1a1ff2baca41503076a90f28b26e3a46
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:22:06 2011 +0900

    [trac547]
     - change order of command line
     - update years of copyright

commit 71cc3a41a32b1e48f334c15a4cfbc8a1534d5a68
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:20:18 2011 +0900

    [trac547] change order of command line

commit 2fadb1f77d8f36fe357e166275d3174429432066
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:14:31 2011 +0900

    [trac547] fix conflicts in rebasing

commit f4536b31c403f574b35a8b739f29c8a343dfb924
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:13:55 2011 +0900

    [trac547] fix CLEANFILES

commit 7099f7086e68e031656575e1de7e37408e6766f7
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:10:10 2011 +0900

    [trac547] remove unnecessary files

commit 990bf36b0a780c2f553e6bfb743983fd8499f149
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:09:43 2011 +0900

    [trac547] change mode

commit 3fa544d227564dc078f016af73a379bf796b1a6f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:08:57 2011 +0900

    [trac547] fix CLEANFILES

commit a5f612a097fef81219e69d35ca0541d249d766d9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 19:08:50 2011 +0900

    [trac547] fix conflicts in rebasing

commit 5b50945c4cba20ea3c9d5614a9ffed4282a68dc9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 11:40:24 2011 +0900

    [trac547] add a proposed Changelog entry

commit 64db0b4022effb361104b480aa8e18794c4b835a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 11:39:54 2011 +0900

    [trac547] fix typo and minor change

commit d5b92ece8d7e840698077715e193bba473c6001f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 9 11:39:30 2011 +0900

    [trac547] minor change

commit d7a5431d2bb40fc92a3e5ab137dd30a08db76c01
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 22:38:38 2011 +0900

    [trac547] add more document

commit fe969b6b25c0415f155e61a2695f5c21c9676b1a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 22:38:29 2011 +0900

    [trac547] add more document

commit ddf3bfb5142ecbb8ab44b731ee70b7767e6f1e83
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 21:41:12 2011 +0900

    [trac547] add more document

commit 078d68e4d2ae9654bb63aafe664fdc24093a1b00
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 21:39:00 2011 +0900

    [trac547]
     - remove ::1 from default setting
     - change descriptions

commit 877553a8cdce7bf7e4360c41b111aa34d9a0dc06
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 21:37:37 2011 +0900

    [trac547] add more document

commit 911422aa5fe5fcbf5a564c164311f7a355833bb1
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 8 09:54:47 2011 +0900

    [trac547] change verbose message

commit 1ffd7904e1bee8890647969fd1ba717a3abd8ea7
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 18:03:56 2011 +0900

    [trac547]
     - add restoring old config data if failed restarting httpd
     - add to a new methods "get_sockets" to return socket list
     - add more verbose messages
     - remove destructor of stats_httpd module and add catching SessionError when stats_httpd object is exiting

commit 07edaadf77a4916ec0104d2081c0d324a0a68750
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 12:27:31 2011 +0900

    [trac547]
     - change URL of XML, XSD and XSL documents
     - add parameter of XSD namespace
     - add default configure
     - add some assertion
     - rename some methods which return XML, XSD and XSL document
     - implement HTTP redirection because of no found document requested
     - remove catching some exceptions because it didn't be needed to be so much strict
     - add error handling when received incorrect configure
     - configurable of multiple IP addresses and ports for HTTP listen (it can hold multiple sockets for HTTP listen)
     - add http closing message for verbose
     - fix some try/except statements
     - add some minor changes and minor refactoring

commit bf176737e6f30f1614aa0fcc4ea427b38806c03d
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 11:59:35 2011 +0900

    [trac547] add some minor changes for testing
     - add/rename some minor parameter
     - remove some minor getter methods

commit 55ee2ba52f6711ddfbef04a100fcddbe7d4a0448
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 11:53:05 2011 +0900

    [trac547]
     - replaced with substitution strings for namespace and url
     - add text decoration of CSS to XSL document

commit dd697e9017d3b9281d7a33337f61fda870e32bc9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:42:31 2011 +0900

    [trac547] add more tests for each class to improve coverage
     - check HTTP status, header and body of response
     - check validations of address and port of both IPv6/4
     - check failure case of some methods of Session object with no socket

commit aab21e054c2aae4b94079e31f7d8b3b51f5e80e6
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:35:39 2011 +0900

    [trac547]
     - remove unnecessary StreamWriter
     - add creating socket object and executing socket.bind() in creating HTTPServer object
     - add some getter methods for unittest
     - add dummy HTTP response class DummyHttpResponse for unittest
     - add dummy writer method as seemed to write file object

commit 5a708dfff4367b7061aa63a0d5fe4c4fea89ebb4
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:22:20 2011 +0900

    [trac547] remove unnecessary module

commit 026883056f9385e9bd2b57ce65238eda84d9ae91
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 20:40:06 2011 +0900

    [trac547] remove an unnecessary item

commit a1481573ac7f973aa38e2d29e70add8a7ec02064
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:30:35 2011 +0900

    [trac547] rename

commit cefd50684e81ce71b34a93b82246cabe4e041ad1
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:04:59 2011 +0900

    [trac547] rename

commit f66155bec008366c14ecfc36830ef77e63dc6a84
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:03:58 2011 +0900

    [trac547] add dummy class, function. variables

commit 268952195f0ceca4dee149e707f489b1d47df6ed
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:03:05 2011 +0900

    [trac547] remove spec files and  templates from test directory

commit e9ecae2e1135573ca19a01804261ed0fef720a9a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:01:52 2011 +0900

    [trac547] rename

commit dfc8dab14d8e9e83c4cdfbbe0c1ccd3113dfe357
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:27:50 2011 +0900

    [trac547]
     - add xml implementations (XML, XSD, XSL)
     - add constructing XML contents with HTTP response
     - add an individual exception
     - add implementation of reloading configure from CfgMgr without restarting process
     - refactor handling exceptions
     - add some minor changes

commit c0eb6840b2d9821fe1c511a60ce59c93ba02f539
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:23:53 2011 +0900

    [trac547] add new member variables (AF_INET, has_ipv6) and a new exception (gaierror) for testing

commit e5c8140b36f74a2b0bc701b26c91f5cef0329b15
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:21:02 2011 +0900

    [trac547] add more tests and refactor

commit 996ffdfc33495112a15a77ddf5cfbbd0073ed2c4
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:19:35 2011 +0900

    [trac547] replace messages with variable in templates

commit e3ae6739060ee490eb3a823100e5ce34a60a3536
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 27 00:42:01 2011 +0900

    [trac547]
    - move the xml files under build dir
    - change suffixes of the xml files (do git-mv) and add their into configure.ac
    - fix wrong paths: change relative to absolute

commit 7b1a63a5afb33f25cc78b3d09920d1cf71461760
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:48:41 2011 +0900

    [trac547] add make of spec files for testing

commit 6cdca232a666fa2a771de93fba218a80534f3bbd
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:44:31 2011 +0900

    [trac547] fix typo

commit 9377ed57cbcc547835a8d6e4d0705053d17ae0a2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:41:59 2011 +0900

    [trac547]
     - remove xml filenames
     - refactor Makefile.am

commit 6b6ccdc5173e7afe280166a1d04760c65aff662e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:20:39 2011 +0900

    [trac547] add configuration of spec filename and xml filenames

commit 8dbba8a494189a3b396d4d4dc9d3af4e41f4dd0f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:56:11 2011 +0900

    [trac547]
     - fix line feed code
     - add variable of template

commit a116845deff6a945d30654168a2099fbca942aa3
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:55:53 2011 +0900

    [trac547]
     - remove $Id$
     - add variable of template

commit 97ee680029535189120ae72714e27fa382da47da
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:55:09 2011 +0900

    [trac547] fix line feed code

commit 168afd55aa4b523a7676210c90d38025c135255f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:54:13 2011 +0900

    [trac547]
    - improve overall structure about classes and functions
    - add paths of xml templates
    - change http handler according to its requests
    - change having verbose variable
    - add including external xml file as template with its maximum size

commit e5265939da84a32fa1229663330671dfd8f26c87
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 08:53:37 2011 +0900

    [trac547] add new dummy standard modules

commit 109d5e271e436d6de6b688b6f101f17babb25bed
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 08:48:26 2011 +0900

    [trac547]
     - add called counter variable of dummy socket instance for unittest
     - change type of return value of function fileno()

commit 35dab46a34d489eefb23845440829c9d7fcc1a59
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 09:20:13 2011 +0900

    [trac547] add template files of xml, xsd and xsl

commit a5a2774e0af4ab0c2ddf9de3c142097ae3fc4a24
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:16:44 2011 +0900

    [trac547] remove dummy_socket from isc.cc.sesssion and place it current directory

commit ff7dc11b9a1a47c471b79b627e81e99685ca6ae2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 12:42:32 2011 +0900

    [trac547] add 'status' and 'shutdown' commands

commit 0e28db3e9f0f340e41950acc4b971f87e3762465
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:36:55 2011 +0900

    [trac547] fix syntax of spec file

commit 8664af36a9650f7a119ad0f232745adf05bfeb62
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:15:01 2011 +0900

    [trac547] change type of return into string

commit 096010ac1d8b8a0873e412b57cb91e4832dd51f9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 14:15:36 2011 +0900

    [trac547] - change copyright
    	  - remove __version__
    	  - add DummySocket class

commit 30925222c3b190a3bc4ee5c7c4767185c11de5a9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] add mocked-up module "b10-stats-httpd" for HTTP/XML interface

commit 06e1ea8ad3e4a6e454366e55b6f1216e76352767
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 21:39:38 2011 +0900

    [trac547] add more tests
     - stats module returns error
     - "shutdown" command is invoked

commit 57a331f019dbe7cfd81a4848b1f83c5355a9a577
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 19:36:58 2011 +0900

    [trac547] add more test

commit 66eb66159d75c4aecd30add2b58fbc3b56f9781a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 18:03:56 2011 +0900

    [trac547]
     - add restoring old config data if failed restarting httpd
     - add to a new methods "get_sockets" to return socket list
     - add more verbose messages
     - remove destructor of stats_httpd module and add catching SessionError when stats_httpd object is exiting

commit 2e2a545038b320a1643a8406cef0211d4e72ce22
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 12:27:31 2011 +0900

    [trac547]
     - change URL of XML, XSD and XSL documents
     - add parameter of XSD namespace
     - add default configure
     - add some assertion
     - rename some methods which return XML, XSD and XSL document
     - implement HTTP redirection because of no found document requested
     - remove catching some exceptions because it didn't be needed to be so much strict
     - add error handling when received incorrect configure
     - configurable of multiple IP addresses and ports for HTTP listen (it can hold multiple sockets for HTTP listen)
     - add http closing message for verbose
     - fix some try/except statements
     - add some minor changes and minor refactoring

commit d145ff5ccf1446f86a37c52eb4dde9d0b79f907e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 12:03:12 2011 +0900

    [trac547]
     - add changes according to changes of the target source code
     - change values of dummy data
     - add more tests

commit 5e9b1d526aa53e2b7fd6b5ceb14280f036ee1ca8
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 12:01:24 2011 +0900

    [trac547]
     - change values of constant parameters for testing
     - add more information in error massages

commit b4f0b370554e75f3248d92a9fb720ea0ffe9dff3
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 11:59:35 2011 +0900

    [trac547] add some minor changes for testing
     - add/rename some minor parameter
     - remove some minor getter methods

commit 45a75048c318ffc817dc464dafdba3641220722a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 11:57:40 2011 +0900

    [trac547] configurable of multiple IP addresses and ports for HTTP listen

commit 1241b73b471cea22e5b0a285d19dafe6d25643a2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Mar 7 11:53:05 2011 +0900

    [trac547]
     - replaced with substitution strings for namespace and url
     - add text decoration of CSS to XSL document

commit a395c6989abade810481d5f3ab9b26d251ef49e9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:55:00 2011 +0900

    [trac547] remove string.py

commit 3d78c648b44ed661585237ee1aab4e69731af191
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:42:31 2011 +0900

    [trac547] add more tests for each class to improve coverage
     - check HTTP status, header and body of response
     - check validations of address and port of both IPv6/4
     - check failure case of some methods of Session object with no socket

commit d93ce6038bb8d770479e0200d6e9aa2b850f7990
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:36:47 2011 +0900

    [trac547] fix B10_FROM_SOURCE

commit a13cf5dee6d9a9f9a0c80d9e1a245df8015fd615
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:35:39 2011 +0900

    [trac547]
     - remove unnecessary StreamWriter
     - add creating socket object and executing socket.bind() in creating HTTPServer object
     - add some getter methods for unittest
     - add dummy HTTP response class DummyHttpResponse for unittest
     - add dummy writer method as seemed to write file object

commit e5617c77c052fa5c3aaff564379bc6e051593eca
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:31:12 2011 +0900

    [trac547]
     - add dummy SessionTimeout exception
     - add raising SeesionError in creating Session object if sokect.error is raised
     - remove printing for debug
     - add raising SessinError in group_{un,}subscribe

commit 09443bccf6fdd4589f7bb5f9c0697418533606ac
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:27:54 2011 +0900

    [trac547] add some assertions

commit 610428e055bbba8a8abc71365393bb15a2980c6e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:27:35 2011 +0900

    [trac547] fix bug (counting how many the socket is selected)

commit 3c95e8e0174e1eb1721d2dc7e451ab2816fe48e8
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:24:06 2011 +0900

    [trac547]
     - add dummy bind function with validation of address and port
     - add status of open/closed
     - add dummy address_family

commit d0bb9911b264d8f08a5ea8a59a953c57029caaef
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:22:20 2011 +0900

    [trac547] remove unnecessary module

commit d714a479c926f72b0a1d98d892e1056d5d5469ec
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Mar 3 21:21:43 2011 +0900

    [trac547]
      - add function to close ModuleCCSession object
      - remove try/except statement in creating ModuleCCSession object
      - add exceptions of OverflowError and TypeError while select.select
      - set http socket object and ModuleCCSession object to None after completing their closes
      - move except select.error to proper position
      - add some minor changes

commit fa47de86a37959ddaad7f47ac54fac20c8d785db
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 20:46:55 2011 +0900

    [trac547]
      - rename spec files
      - add global variables of URL
      - refactor creating http socket
      - add some minor changes

commit 9781a86080345cdb085dca2b667ca02a519b0c11
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 20:44:52 2011 +0900

    [trac547]
      - rename spec files
      - move location of spec files from build dir to source dir

commit 84a0c6b23fe609e1fb398ba8fb48897564d33368
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 20:42:25 2011 +0900

    [trac547] remove finally statement

commit 13093acdffb42c77ca725e2eac88087b1f7c2bd7
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 20:40:06 2011 +0900

    [trac547] remove an unnecessary item

commit 38f98df2d10d48d76ae59b92e88fb117af99f856
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:30:45 2011 +0900

    [trac547] rename

commit a413ae557a06398e8289fc502bb028ffb7b89c81
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:30:35 2011 +0900

    [trac547] rename

commit c294d35340634a3a228e638c700d26c1fad565fe
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:04:59 2011 +0900

    [trac547] rename

commit bb7424d215a4e29fee901b221dff2b13e9310f8f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:04:45 2011 +0900

    [trac547] change loading JSON-formatted specfile

commit be666219db38d2a34bcdee16080b9fa04f5e515b
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:03:58 2011 +0900

    [trac547] add dummy class, function. variables

commit 42681186cce76bbffe616fd29400cf4d320bdc4b
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:03:05 2011 +0900

    [trac547] remove spec files and  templates from test directory

commit bcc4433b55302f8a62e8c86c4825cbe6b445f8aa
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:02:21 2011 +0900

    [trac547] rename

commit 6b7ad716ba77af5ca5dbe2b7852ccb3e5c2454c3
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Mar 2 16:01:52 2011 +0900

    [trac547] rename

commit 6372e1e1842f26ea3a70780c99a3ad4fdc35643f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:27:50 2011 +0900

    [trac547]
     - add xml implementations (XML, XSD, XSL)
     - add constructing XML contents with HTTP response
     - add an individual exception
     - add implementation of reloading configure from CfgMgr without restarting process
     - refactor handling exceptions
     - add some minor changes

commit bc7a1c5a0aaf5c15ff8a793280d6e6a8e771a5dc
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:23:53 2011 +0900

    [trac547] add new member variables (AF_INET, has_ipv6) and a new exception (gaierror) for testing

commit 01dae68a7cc5bf99792d2a3b515acf23bcbb5ae5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:22:44 2011 +0900

    [trac547] add assertions

commit 44d4cfb40e5a2138b53a94aa91da9783c73e3cb8
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:22:22 2011 +0900

    [trac547] add a new dummy function to clear queues for testing

commit a5dbc1cb756861919a9f0cf5f71cd6efba4aafc8
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:21:33 2011 +0900

    [trac547] add a new member variable as dummy

commit 921bc4963d2393af943ffd71d15c58426a8d0656
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:21:02 2011 +0900

    [trac547] add more tests and refactor

commit 87853eeaa76546fc7dd933be4e87daac0fc7c321
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:20:08 2011 +0900

    [trac547] fix typo

commit c906185a749417281336655bd742a99b5b194200
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Mar 1 22:19:35 2011 +0900

    [trac547] replace messages with variable in templates

commit a1c8f39df1b4d3767fcaf9d4b85e36fff863af04
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 27 00:42:01 2011 +0900

    [trac547]
    - move the xml files under build dir
    - change suffixes of the xml files (do git-mv) and add their into configure.ac
    - fix wrong paths: change relative to absolute

commit 83f2df7e1b7d8f8170f05816b94a9841c63152be
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:48:41 2011 +0900

    [trac547] add make of spec files for testing

commit 2e1ec218f44c14716cd971c78547e8525d6ccac1
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:48:02 2011 +0900

    [trac547] move position of B10_FROM_BUILD

commit 14d74270f32cd34532840b4748ea03e55337efe0
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:47:42 2011 +0900

    [trac547]
    - add this year of copyright
    - remove __version__
    - change SPECFILE_LOCATION

commit cf1429df42d50a74dea6c0ca11e1ee027f133e7f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:47:25 2011 +0900

    [trac547] add imp.reload in order to avoid to B10_FROM_BUILD be changeed in other test case

commit c95283504aeda27288e96adf25e777855595bac5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:45:06 2011 +0900

    [trac547] fix environment variable B10_FROM_BUILD

commit 236b0928cb577cfa0ffa5f88d4da221d878284c5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:44:31 2011 +0900

    [trac547] fix typo

commit 96403e587e5664c88fbf29d9f370eb314a1e2b1d
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:44:18 2011 +0900

    [trac547]
    - change SPECFILE_LOCATION
    - remove unnecessary debug print

commit f6853e73cca16fa764d96caf211d5c35d091a475
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:43:47 2011 +0900

    [trac547]
    - add this year of copyright
    - remove __version__
    - change SPECFILE_LOCATION

commit 12576cdc7ecf062e7b2e2c25771f267ae633a6cd
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:42:45 2011 +0900

    [trac547] move position of B10_FROM_BUILD

commit f2b004871d34de08acbf3d972f1230ee4459d862
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:42:39 2011 +0900

    [trac547] move position of B10_FROM_BUILD

commit 13ba665b40ca057c1c5cd4115315c7a1bf7b6f08
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 22:41:59 2011 +0900

    [trac547]
     - remove xml filenames
     - refactor Makefile.am

commit 0e6ab01a553a5bc9b41419a9fe9ef2ba1a62a291
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:22:54 2011 +0900

    [trac547] implement function get_value in dummy ConfigData class

commit 5339cde8a4faeccd40ec591eb39597d67ae98c7d
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:22:08 2011 +0900

    [trac547] change name of member variable in dummuy socket class

commit 9ad01a854a2f0653a9edd3ee9c449b441cac224a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:21:33 2011 +0900

    [trac547] fix wrong variable name of dummuy socket

commit 83aafa63f0ae68448a2a074052bf409d83850054
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:20:39 2011 +0900

    [trac547] add configuration of spec filename and xml filenames

commit a894f43653ee7fa944d6bb9a6f52c4079091bd88
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 21:20:10 2011 +0900

    [trac547] improve obtaining spec filename and xml filenames from configures in the specfile instead of global variables in this script

commit 3ca08ffa87665a4a8fb0b0789884ae5141b2fab0
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 11:57:38 2011 +0900

    [trac547] make closed parameter hidden because original socket class doesn't have it

commit a6b8d7d481527fa31ddf1101039af1fad6fbd64e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 11:48:15 2011 +0900

    [trac547] remove function get_socket() because original module doesn't have it

commit 14ae71b676dd2f2054ad83dae36f1ffc0863dc36
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:57:47 2011 +0900

    [trac547]
     - improve overall unittest according to change of the target module stats_httpd.py
     - improve coverage percent

commit ebf0005bffb32bd3f2f92ef75fe539c17ba60453
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:56:11 2011 +0900

    [trac547]
     - fix line feed code
     - add variable of template

commit 9f544262de4c048f98424094d89930f5d4a6dc63
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:55:53 2011 +0900

    [trac547]
     - remove $Id$
     - add variable of template

commit f16f7cda3ad196d6e73594b1d366b5eec66668db
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:55:09 2011 +0900

    [trac547] fix line feed code

commit b957606cfcf9dc0594478e5af7282aa430b79a65
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:54:13 2011 +0900

    [trac547]
    - improve overall structure about classes and functions
    - add paths of xml templates
    - change http handler according to its requests
    - change having verbose variable
    - add including external xml file as template with its maximum size

commit dcd374777698b5778c9aee8c4326d41439087c5f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:45:44 2011 +0900

    [trac547]
    - rename dummy socket
    - add dummy modules select and string

commit 5cfbe4f80fb6d8017f132191e8c56399646448e3
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:44:47 2011 +0900

    [trac547]
    - rename dummy socket
    - change condition that the session is open/closed
    - add functions group_{subscribe,unsubscribe}

commit 78fb6102ab1ad797e5c42f2d9bb023a43570eda9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 09:40:03 2011 +0900

    [trac547]
    - rename dummy socket
    - add handler instance as a member variable
    - add some dummy function

commit d5adf676e2bd122bcd02d407aae0ca1b53548046
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 08:54:14 2011 +0900

    [trac547] rename from dummy_socket to sockect

commit 45d4cf8cda555bde75601166e21a78ede911cce0
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 08:53:37 2011 +0900

    [trac547] add new dummy standard modules

commit 99828ca78fc5ab04136fee237b15a1bfdc276183
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Fri Feb 25 08:48:26 2011 +0900

    [trac547]
     - add called counter variable of dummy socket instance for unittest
     - change type of return value of function fileno()

commit bcde855c1138a395870f87efa54043b7e9e6dab2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 15:41:40 2011 +0900

    [trac547] add send_error for dummy

commit d5e3048bca3d408acd30045a826a003f94e149f5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 15:41:00 2011 +0900

    [trac547]
     - fix content-type name
     - fix string encoding
     - fix minor problem

commit 85dd690f9b3cf54c7750932a6ba03542ab6de4f2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 15:39:29 2011 +0900

    [trac547] add xml templates

commit e98133b50f1bf84e9b483e20533686fd8365023f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 09:49:46 2011 +0900

    [trac547] add importing shutil

commit c114768f7fd8d01aa3ce62e2cd087efcdb0937bd
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 09:23:29 2011 +0900

    [trac547]
    - add template files of xml, xsd and xsl
    - add more implements for do_GET, do_HEAD
    - add implement to gathering statistics data from remote stats module
    - add minor changes

commit 21bfbd09e9309380b6eb28e470ec2fd2d3ed39d8
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 23 09:20:13 2011 +0900

    [trac547] add template files of xml, xsd and xsl

commit 20209730fb11c1a425fbfac1a0ee3391f2cca9b9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 22:33:19 2011 +0900

    [trac547] change default verbose mode
    [trac547] change variable name "running"
    [trac547] change minor verbose message
    [trac547] fix missing function "check_command" in CCSessionListener class
    [trac547] add PID with 'status' command

commit 315d90575d5158fd949ccc65294cc9ee79305843
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 21:40:45 2011 +0900

    [trac547] correct variable name

commit 9d8aaf9f58ffac492ffaeafcc913f9417d77827c
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:21:47 2011 +0900

    [trac547] correct the example message

commit 1a89dd69929bcb415f002e3320c274ffd8e07045
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:17:11 2011 +0900

    [trac547] add dummy http.server

commit 6d7cc79caae006682d116e1edb3d3c833459b489
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:16:44 2011 +0900

    [trac547] remove dummy_socket from isc.cc.sesssion and place it current directory

commit 27f96dceb36840f8ba73091b6312d3cf9ce2de22
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:13:04 2011 +0900

    [trac547] add test cases for CCSessionLister, HttpListener and HttpHandler

commit c57c0b538bf329d316b7aeb1320e4e1debadde5d
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:11:04 2011 +0900

    [trac547] add new sub directory "http" and dummy scokect "dummy_socket.py"

commit bd449d4c2ef348c6fb32556e7f072143d94869ff
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:09:53 2011 +0900

    [trac547] implement http.server
    [trac547] add some new classes , CCSessionListener, HttpListener, HttpHandler

commit 50361c232fc5e913eb1920ed02112179e897b86f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 20:07:50 2011 +0900

    [trac547] add new Makefile for dummy http.server

commit baf91fc46b3a8881091ca05f849b365af21c3b49
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 12:43:34 2011 +0900

    [trac547] add a test case for 'status' command

commit 2b891c98caa35d5f3d9715f36cfe9e31794f63e0
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 12:42:32 2011 +0900

    [trac547] add 'status' and 'shutdown' commands

commit cf2017e93d1d4845c1d41b9d198c636a65706381
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Sun Feb 20 12:41:48 2011 +0900

    [trac547] add status command and change some messages

commit 679a109130f63eb6a820473fb30426e3c17a6201
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 17:23:11 2011 +0900

    [trac547] correct spelling

commit bc0485db91d2d79a8e8450ee8d49a4ac98d5c535
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 16:23:09 2011 +0900

    [trac547] assign the shorter process name

commit 0a52986a0e0a5b3ca7925ae8e73bf3f8005c9131
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:36:55 2011 +0900

    [trac547] fix syntax of spec file

commit f166f1608de3c48742ca8b682f30a9383bb64c46
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:36:11 2011 +0900

    [trac547] fix calling main function

commit cce0dcba32deb575e5c869dd487473bcfc138c6d
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:19:20 2011 +0900

    [trac547] add assertion of rising 'TypeError'

commit a63bb5398e8479a3fe0ca5de7c344707203fe777
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 15:15:01 2011 +0900

    [trac547] change type of return into string

commit 2221a46dbe11fb4bb0a016674e9cfdf8127767dc
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 14:15:36 2011 +0900

    [trac547] - change copyright
    	  - remove __version__
    	  - add DummySocket class

commit 2527c49395978095a4f0b81554d3a221ecf8851c
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 14:14:24 2011 +0900

    [trac547] remove __version__

commit ec73d6a6a2d447677a702ba765d5521e1423ef94
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 14:13:54 2011 +0900

    [trac547] change copyright

commit ff7c29ea831f78c04707a663df44552963527f4b
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 14:13:04 2011 +0900

    [trac547] add get_socket function to ModuleCCSession class

commit 2efe389c60b01516bf1df57acb3146384d4a4364
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 16 11:25:33 2011 +0900

    [trac547] fixed minor mistakes

commit 555a272df462c52bf701ef589b18af2f1d30dc5a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] necessary more changes for adding "b10-stats-httpd" module
    [trac547] added "shutdown" command handling to "b10-stats-httpd" module

commit 3b968fa370ddb96f3aaeaea5b62888f80ad095ee
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] change configure.ac for module "b10-stats-httpd"

commit a9cb28f960c0c36f9e0fc466a9053752996f78f9
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] add mocked-up module "b10-stats-httpd" for HTTP/XML interface

commit fa6e6f53c476a8fb02a8368ea5f656ea5219057f
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] add mocked-up module "b10-stats-httpd" for HTTP/XML interface

commit 39be3c50d2624f7e72adfa509e4ca96f25ae2ed5
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Thu Feb 3 20:40:51 2011 +0900

    [trac547] removed unnecessary module "b10-stats_stub" including related files

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

Summary of changes:
 ChangeLog                                          |   26 +++
 Makefile.am                                        |    7 +-
 README                                             |    2 -
 configure.ac                                       |   13 ++
 doc/guide/bind10-guide.xml                         |   15 +--
 src/bin/auth/auth.spec.pre.in                      |   10 +-
 src/bin/auth/b10-auth.8                            |   16 ++-
 src/bin/auth/b10-auth.xml                          |   11 +-
 src/bin/auth/main.cc                               |    8 +-
 src/bin/bind10/bind10.py.in                        |   34 +++
 .../tests/{bind10_test.py => bind10_test.py.in}    |   51 +++++-
 src/bin/cfgmgr/b10-cfgmgr.py.in                    |   14 +-
 src/bin/resolver/b10-resolver.8                    |    2 +-
 src/bin/resolver/b10-resolver.xml                  |    5 +-
 src/bin/resolver/main.cc                           |    1 -
 src/bin/resolver/resolver.spec.pre.in              |    6 +-
 src/bin/stats/Makefile.am                          |    5 +-
 src/bin/stats/run_b10-stats.sh.in                  |    6 +-
 src/bin/stats/tests/b10-stats-httpd_test.py        |    3 +-
 src/bin/stats/tests/stats_test.in                  |    6 +-
 src/bin/xfrout/xfrout.py.in                        |    6 +-
 src/lib/asiolink/Makefile.am                       |    1 +
 src/lib/asiolink/io_fetch.cc                       |    8 +-
 src/lib/asiolink/{io_endpoint.cc => qid_gen.cc}    |   52 +++--
 src/lib/asiolink/qid_gen.h                         |   85 ++++++++
 src/lib/asiolink/tests/Makefile.am                 |    1 +
 src/lib/asiolink/tests/qid_gen_unittest.cc         |   59 +++++
 tests/Makefile.am                                  |    1 +
 tests/system/Makefile.am                           |   13 ++
 tests/system/README                                |   62 ++++++
 tests/system/cleanall.sh                           |   33 +++
 tests/system/conf.sh.in                            |   54 +++++
 tests/system/glue/auth.good                        |   15 ++
 tests/system/glue/clean.sh                         |   23 ++
 tests/system/glue/example.good                     |   19 ++
 tests/system/glue/noglue.good                      |   14 ++
 tests/system/glue/nsx1/b10-config.db.in            |    9 +
 tests/system/glue/nsx1/com.db                      |   31 +++
 tests/system/glue/nsx1/net.db                      |   32 +++
 tests/system/glue/nsx1/root-servers.nil.db         |   26 +++
 tests/system/glue/nsx1/root.db                     |   55 +++++
 tests/system/glue/setup.sh.in                      |   25 +++
 tests/system/glue/test.good                        |   19 ++
 tests/system/glue/tests.sh                         |   66 ++++++
 tests/system/ifconfig.sh                           |  226 ++++++++++++++++++++
 tests/system/run.sh                                |  125 +++++++++++
 tests/system/runall.sh                             |   44 ++++
 tests/system/start.pl                              |  226 ++++++++++++++++++++
 tests/system/stop.pl                               |  188 ++++++++++++++++
 49 files changed, 1684 insertions(+), 75 deletions(-)
 rename src/bin/bind10/tests/{bind10_test.py => bind10_test.py.in} (88%)
 mode change 100755 => 100644 src/bin/stats/stats.py.in
 copy src/lib/asiolink/{io_endpoint.cc => qid_gen.cc} (51%)
 create mode 100644 src/lib/asiolink/qid_gen.h
 create mode 100644 src/lib/asiolink/tests/qid_gen_unittest.cc
 create mode 100644 tests/Makefile.am
 create mode 100644 tests/system/Makefile.am
 create mode 100644 tests/system/README
 create mode 100755 tests/system/cleanall.sh
 create mode 100755 tests/system/conf.sh.in
 create mode 100644 tests/system/glue/auth.good
 create mode 100755 tests/system/glue/clean.sh
 create mode 100644 tests/system/glue/example.good
 create mode 100644 tests/system/glue/noglue.good
 create mode 100644 tests/system/glue/nsx1/b10-config.db.in
 create mode 100644 tests/system/glue/nsx1/com.db
 create mode 100644 tests/system/glue/nsx1/net.db
 create mode 100644 tests/system/glue/nsx1/root-servers.nil.db
 create mode 100644 tests/system/glue/nsx1/root.db
 create mode 100755 tests/system/glue/setup.sh.in
 create mode 100644 tests/system/glue/test.good
 create mode 100755 tests/system/glue/tests.sh
 create mode 100755 tests/system/ifconfig.sh
 create mode 100755 tests/system/run.sh
 create mode 100755 tests/system/runall.sh
 create mode 100755 tests/system/start.pl
 create mode 100755 tests/system/stop.pl

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 0c80261..2900ce9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,32 @@
 	through web browsers and its data types are strictly defined.
 	(Trac #547, git tbdtbdtbdtbdtbdtbdtbdtbdtbdtbdtbdtbdttbd)
 
+  193.	[func]*		jreed
+	Listen on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses
+	for b10-auth. This returns to previous behavior prior to
+	change #184. Document the listen_on configuration in manual.
+	(Trac #649, git 65a77d8fde64d464c75917a1ab9b6b3f02640ca6)
+
+  192.	[func]*		jreed
+	Listen on standard domain port 53 for b10-auth and
+	b10-resolver.
+	(Trac #617, #618, git 137a6934a14cf0c5b5c065e910b8b364beb0973f)
+
+  191.	[func]		jinmei
+	Imported system test framework of BIND 9.  It can be run by
+	'make systest' at the top source directory.  Notes: currently it
+	doesn't work when built in a separate tree.  It also requires
+	perl, an inherited dependency from the original framework.
+	Also, mainly for the purpose of tests, a new option "--pid-file"
+	was added to BoB, with which the boss process will dump its PID
+	to the specified file.
+	(Trac #606, git 6ac000df85625f5921e8895a1aafff5e4be3ba9c)
+
+  190.	[func]		jelte
+	Resolver now sets random qids on outgoing queries using
+	the boost::mt19937 prng.
+	(Trac #583, git 5222b51a047d8f2352bc9f92fd022baf1681ed81)
+
   189.	[bug]		jreed
 	Do not install the log message compiler.
 	(Trac #634, git eb6441aca464980d00e3ff827cbf4195c5a7afc5)
diff --git a/Makefile.am b/Makefile.am
index 9a28f20..e31a1a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = doc src
+SUBDIRS = doc src tests
 USE_LCOV=@USE_LCOV@
 LCOV=@LCOV@
 GENHTML=@GENHTML@
@@ -77,6 +77,11 @@ cppcheck:
 		--template '{file}:{line}: check_fail: {message} ({severity},{id})' \
 		src
 
+# system tests
+systest:
+	cd tests/system; \
+	sh $(abs_srcdir)/tests/system/runall.sh
+
 #### include external sources in the distributed tarball:
 EXTRA_DIST = ext/asio/README
 EXTRA_DIST += ext/asio/asio/local/stream_protocol.hpp
diff --git a/README b/README
index 5bc3154..b10d12e 100644
--- a/README
+++ b/README
@@ -164,8 +164,6 @@ source tree:
 (Which will use the modules and configurations also from the source
 tree.)
 
-The server will listen on port 5300 for DNS requests.
-
 CONFIGURATION
 
 Commands can be given through the bindctl tool.
diff --git a/configure.ac b/configure.ac
index 91cf497..4bbfc92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -583,6 +583,12 @@ if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
 	CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1"
 fi
 
+#
+# Perl is optional; it is used only by some of the system test scripts.
+#
+AC_PATH_PROGS(PERL, perl5 perl)
+AC_SUBST(PERL)
+
 AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
   [regenerate man pages [default=no]])], enable_man=yes, enable_man=no)
 
@@ -684,6 +690,8 @@ AC_CONFIG_FILES([Makefile
                  src/lib/cache/tests/Makefile
                  src/lib/server_common/Makefile
                  src/lib/server_common/tests/Makefile
+                 tests/Makefile
+                 tests/system/Makefile
                ])
 AC_OUTPUT([doc/version.ent
            src/bin/cfgmgr/b10-cfgmgr.py
@@ -717,6 +725,7 @@ AC_OUTPUT([doc/version.ent
            src/bin/stats/tests/stats_test
            src/bin/bind10/bind10.py
            src/bin/bind10/tests/bind10_test
+           src/bin/bind10/tests/bind10_test.py
            src/bin/bind10/run_bind10.sh
            src/bin/bindctl/run_bindctl.sh
            src/bin/bindctl/bindctl-source.py
@@ -744,6 +753,9 @@ AC_OUTPUT([doc/version.ent
            src/lib/cc/session_config.h.pre
            src/lib/cc/tests/session_unittests_config.h
            src/lib/log/tests/run_time_init_test.sh
+           tests/system/conf.sh
+           tests/system/glue/setup.sh
+           tests/system/glue/nsx1/b10-config.db
           ], [
            chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
            chmod +x src/bin/xfrin/run_b10-xfrin.sh
@@ -768,6 +780,7 @@ AC_OUTPUT([doc/version.ent
            chmod +x src/lib/dns/gen-rdatacode.py
            chmod +x src/lib/dns/tests/testdata/gen-wiredata.py
            chmod +x src/lib/log/tests/run_time_init_test.sh
+           chmod +x tests/system/conf.sh
           ])
 AC_OUTPUT
 
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index 0935c81..bceb40c 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -336,14 +336,6 @@ var/
         </simpara>
       </note>
 
-      <note>
-        <simpara>
-          The development prototype of the b10-auth server listens on
-          0.0.0.0 (all interfaces) port 5300. (This is not the standard
-          domain service port.)
-        </simpara>
-      </note>
-
       <para>
         To quickly get started with BIND 10, follow these steps.
       </para>
@@ -397,7 +389,7 @@ var/
         <listitem>
 
          <para>Test it; for example:
-            <screen>$ <userinput>dig @127.0.0.1 -p 5300 -c CH -t TXT authors.bind</userinput></screen>
+            <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT authors.bind</userinput></screen>
          </para>
         </listitem>
 
@@ -1044,11 +1036,6 @@ TODO
       process.
     </para>
 
-    <note><simpara>
-      This development prototype release listens on all interfaces
-      and the non-standard port 5300.
-    </simpara></note>
-
     <section>
       <title>Server Configurations</title>
 
diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in
index e95dabd..d88ffb5 100644
--- a/src/bin/auth/auth.spec.pre.in
+++ b/src/bin/auth/auth.spec.pre.in
@@ -63,12 +63,12 @@
         "item_optional": false,
         "item_default": [
           {
-            "address": "::1",
-            "port": 5300
+            "address": "::",
+            "port": 53
           },
           {
-            "address": "127.0.0.1",
-            "port": 5300
+            "address": "0.0.0.0",
+            "port": 53
           }
         ],
         "list_item_spec": {
@@ -87,7 +87,7 @@
               "item_name": "port",
               "item_type": "integer",
               "item_optional": false,
-              "item_default": 5300
+              "item_default": 53
             }
           ]
         }
diff --git a/src/bin/auth/b10-auth.8 b/src/bin/auth/b10-auth.8
index dcbe6d8..0356683 100644
--- a/src/bin/auth/b10-auth.8
+++ b/src/bin/auth/b10-auth.8
@@ -2,12 +2,12 @@
 .\"     Title: b10-auth
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\"      Date: February 22, 2011
+.\"      Date: March 8, 2011
 .\"    Manual: BIND10
 .\"    Source: BIND10
 .\"  Language: English
 .\"
-.TH "B10\-AUTH" "8" "February 22, 2011" "BIND10" "BIND10"
+.TH "B10\-AUTH" "8" "March 8, 2011" "BIND10" "BIND10"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -70,6 +70,18 @@ defines the path to the SQLite3 zone file when using the sqlite datasource\&. Th
 /usr/local/var/bind10\-devel/zone\&.sqlite3\&.
 .PP
 
+\fIlisten_on\fR
+is a list of addresses and ports for
+\fBb10\-auth\fR
+to listen on\&. The list items are the
+\fIaddress\fR
+string and
+\fIport\fR
+number\&. By default,
+\fBb10\-auth\fR
+listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&.
+.PP
+
 \fIdatasources\fR
 configures data sources\&. The list items include:
 \fItype\fR
diff --git a/src/bin/auth/b10-auth.xml b/src/bin/auth/b10-auth.xml
index ce80689..2b53394 100644
--- a/src/bin/auth/b10-auth.xml
+++ b/src/bin/auth/b10-auth.xml
@@ -20,7 +20,7 @@
 <refentry>
 
   <refentryinfo>
-    <date>February 22, 2011</date>
+    <date>March 8, 2011</date>
   </refentryinfo>
 
   <refmeta>
@@ -132,6 +132,15 @@
     </para>
 
     <para>
+      <varname>listen_on</varname> is a list of addresses and ports for
+      <command>b10-auth</command> to listen on.
+      The list items are the <varname>address</varname> string
+      and <varname>port</varname> number.
+      By default, <command>b10-auth</command> listens on port 53
+      on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
+    </para>
+
+    <para>
       <varname>datasources</varname> configures data sources.
       The list items include:
       <varname>type</varname> to optionally choose the data source type
diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc
index 275ae7d..0701b94 100644
--- a/src/bin/auth/main.cc
+++ b/src/bin/auth/main.cc
@@ -122,7 +122,13 @@ main(int argc, char* argv[]) {
     ModuleCCSession* config_session = NULL;
     string xfrout_socket_path;
     if (getenv("B10_FROM_BUILD") != NULL) {
-        xfrout_socket_path = string(getenv("B10_FROM_BUILD")) + "/auth_xfrout_conn";
+        if (getenv("B10_FROM_SOURCE_LOCALSTATEDIR")) {
+            xfrout_socket_path = string("B10_FROM_SOURCE_LOCALSTATEDIR") +
+                "/auth_xfrout_conn";
+        } else {
+            xfrout_socket_path = string(getenv("B10_FROM_BUILD")) +
+                "/auth_xfrout_conn";
+        }
     } else {
         xfrout_socket_path = UNIX_SOCKET_FILE;
     }
diff --git a/src/bin/bind10/bind10.py.in b/src/bin/bind10/bind10.py.in
index 06f141e..b90c68c 100755
--- a/src/bin/bind10/bind10.py.in
+++ b/src/bin/bind10/bind10.py.in
@@ -790,6 +790,35 @@ def process_rename(option, opt_str, value, parser):
     """Function that renames the process if it is requested by a option."""
     isc.util.process.rename(value)
 
+def dump_pid(pid_file):
+    """
+    Dump the PID of the current process to the specified file.  If the given
+    file is None this function does nothing.  If the file already exists,
+    the existing content will be removed.  If a system error happens in
+    creating or writing to the file, the corresponding exception will be
+    propagated to the caller.
+    """
+    if pid_file is None:
+        return
+    f = open(pid_file, "w")
+    f.write('%d\n' % os.getpid())
+    f.close()
+
+def unlink_pid_file(pid_file):
+    """
+    Remove the given file, which is basically expected to be the PID file
+    created by dump_pid().  The specified may or may not exist; if it
+    doesn't this function does nothing.  Other system level errors in removing
+    the file will be propagated as the corresponding exception.
+    """
+    if pid_file is None:
+        return
+    try:
+        os.unlink(pid_file)
+    except OSError as error:
+        if error.errno is not errno.ENOENT:
+            raise
+
 def main():
     global options
     global boss_of_bind
@@ -810,6 +839,9 @@ def main():
     parser.add_option("--pretty-name", type="string", action="callback",
                       callback=process_rename,
                       help="Set the process name (displayed in ps, top, ...)")
+    parser.add_option("--pid-file", dest="pid_file", type="string",
+                      default=None,
+                      help="file to dump the PID of the BIND 10 process")
     (options, args) = parser.parse_args()
     if args:
         parser.print_help()
@@ -870,6 +902,7 @@ def main():
         sys.stderr.write("[bind10] Error on startup: %s\n" % startup_result)
         sys.exit(1)
     sys.stdout.write("[bind10] BIND 10 started\n")
+    dump_pid(options.pid_file)
 
     # send "bind10.boot_time" to b10-stats
     time.sleep(1) # wait a second
@@ -923,6 +956,7 @@ def main():
     signal.signal(signal.SIGCHLD, signal.SIG_DFL)
     boss_of_bind.shutdown()
     sys.stdout.write("[bind10] BIND 10 exiting\n");
+    unlink_pid_file(options.pid_file)
     sys.exit(0)
 
 if __name__ == "__main__":
diff --git a/src/bin/bind10/tests/bind10_test.py b/src/bin/bind10/tests/bind10_test.py
deleted file mode 100644
index c241d33..0000000
--- a/src/bin/bind10/tests/bind10_test.py
+++ /dev/null
@@ -1,424 +0,0 @@
-from bind10 import ProcessInfo, BoB
-
-# XXX: environment tests are currently disabled, due to the preprocessor
-#      setup that we have now complicating the environment
-
-import unittest
-import sys
-import os
-import signal
-import socket
-from isc.net.addr import IPAddr
-
-class TestProcessInfo(unittest.TestCase):
-    def setUp(self):
-        # redirect stdout to a pipe so we can check that our
-        # process spawning is doing the right thing with stdout
-        self.old_stdout = os.dup(sys.stdout.fileno())
-        self.pipes = os.pipe()
-        os.dup2(self.pipes[1], sys.stdout.fileno())
-        os.close(self.pipes[1])
-        # note that we use dup2() to restore the original stdout
-        # to the main program ASAP in each test... this prevents
-        # hangs reading from the child process (as the pipe is only
-        # open in the child), and also insures nice pretty output
-
-    def tearDown(self):
-        # clean up our stdout munging
-        os.dup2(self.old_stdout, sys.stdout.fileno())
-        os.close(self.pipes[0])
-
-    def test_init(self):
-        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ])
-        os.dup2(self.old_stdout, sys.stdout.fileno())
-        self.assertEqual(pi.name, 'Test Process')
-        self.assertEqual(pi.args, [ '/bin/echo', 'foo' ])
-#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
-#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'] })
-        self.assertEqual(pi.dev_null_stdout, False)
-        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
-        self.assertNotEqual(pi.process, None)
-        self.assertTrue(type(pi.pid) is int)
-
-#    def test_setting_env(self):
-#        pi = ProcessInfo('Test Process', [ '/bin/true' ], env={'FOO': 'BAR'})
-#        os.dup2(self.old_stdout, sys.stdout.fileno())
-#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
-#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'],
-#                                   'FOO': 'BAR' })
-
-    def test_setting_null_stdout(self):
-        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ], 
-                         dev_null_stdout=True)
-        os.dup2(self.old_stdout, sys.stdout.fileno())
-        self.assertEqual(pi.dev_null_stdout, True)
-        self.assertEqual(os.read(self.pipes[0], 100), b"")
-
-    def test_respawn(self):
-        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ])
-        # wait for old process to work...
-        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
-        # respawn it
-        old_pid = pi.pid
-        pi.respawn()
-        os.dup2(self.old_stdout, sys.stdout.fileno())
-        # make sure the new one started properly
-        self.assertEqual(pi.name, 'Test Process')
-        self.assertEqual(pi.args, [ '/bin/echo', 'foo' ])
-#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
-#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'] })
-        self.assertEqual(pi.dev_null_stdout, False)
-        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
-        self.assertNotEqual(pi.process, None)
-        self.assertTrue(type(pi.pid) is int)
-        self.assertNotEqual(pi.pid, old_pid)
-
-class TestBoB(unittest.TestCase):
-    def test_init(self):
-        bob = BoB()
-        self.assertEqual(bob.verbose, False)
-        self.assertEqual(bob.msgq_socket_file, None)
-        self.assertEqual(bob.cc_session, None)
-        self.assertEqual(bob.ccs, None)
-        self.assertEqual(bob.processes, {})
-        self.assertEqual(bob.dead_processes, {})
-        self.assertEqual(bob.runnable, False)
-        self.assertEqual(bob.uid, None)
-        self.assertEqual(bob.username, None)
-        self.assertEqual(bob.nocache, False)
-        self.assertEqual(bob.cfg_start_auth, True)
-        self.assertEqual(bob.cfg_start_resolver, False)
-
-    def test_init_alternate_socket(self):
-        bob = BoB("alt_socket_file")
-        self.assertEqual(bob.verbose, False)
-        self.assertEqual(bob.msgq_socket_file, "alt_socket_file")
-        self.assertEqual(bob.cc_session, None)
-        self.assertEqual(bob.ccs, None)
-        self.assertEqual(bob.processes, {})
-        self.assertEqual(bob.dead_processes, {})
-        self.assertEqual(bob.runnable, False)
-        self.assertEqual(bob.uid, None)
-        self.assertEqual(bob.username, None)
-        self.assertEqual(bob.nocache, False)
-        self.assertEqual(bob.cfg_start_auth, True)
-        self.assertEqual(bob.cfg_start_resolver, False)
-
-# Class for testing the BoB start/stop components routines.
-#
-# Although testing that external processes start is outside the scope
-# of the unit test, by overriding the process start methods we can check
-# that the right processes are started depending on the configuration
-# options.
-class StartStopCheckBob(BoB):
-    def __init__(self):
-        BoB.__init__(self)
-
-# Set flags as to which of the overridden methods has been run.
-        self.msgq = False
-        self.cfgmgr = False
-        self.ccsession = False
-        self.auth = False
-        self.resolver = False
-        self.xfrout = False
-        self.xfrin = False
-        self.zonemgr = False
-        self.stats = False
-        self.stats_httpd = False
-        self.cmdctl = False
-        self.c_channel_env = {}
-
-    def read_bind10_config(self):
-        # Configuration options are set directly
-        pass
-
-    def start_msgq(self, c_channel_env):
-        self.msgq = True
-
-    def start_cfgmgr(self, c_channel_env):
-        self.cfgmgr = True
-
-    def start_ccsession(self, c_channel_env):
-        self.ccsession = True
-
-    def start_auth(self, c_channel_env):
-        self.auth = True
-
-    def start_resolver(self, c_channel_env):
-        self.resolver = True
-
-    def start_xfrout(self, c_channel_env):
-        self.xfrout = True
-
-    def start_xfrin(self, c_channel_env):
-        self.xfrin = True
-
-    def start_zonemgr(self, c_channel_env):
-        self.zonemgr = True
-
-    def start_stats(self, c_channel_env):
-        self.stats = True
-
-    def start_stats_httpd(self, c_channel_env):
-        self.stats_httpd = True
-
-    def start_cmdctl(self, c_channel_env):
-        self.cmdctl = True
-
-    # We don't really use all of these stop_ methods. But it might turn out
-    # someone would add some stop_ method to BoB and we want that one overriden
-    # in case he forgets to update the tests.
-    def stop_msgq(self):
-        self.msgq = False
-
-    def stop_cfgmgr(self):
-        self.cfgmgr = False
-
-    def stop_ccsession(self):
-        self.ccsession = False
-
-    def stop_auth(self):
-        self.auth = False
-
-    def stop_resolver(self):
-        self.resolver = False
-
-    def stop_xfrout(self):
-        self.xfrout = False
-
-    def stop_xfrin(self):
-        self.xfrin = False
-
-    def stop_zonemgr(self):
-        self.zonemgr = False
-
-    def stop_stats(self):
-        self.stats = False
-
-    def stop_stats_httpd(self):
-        self.stats_httpd = False
-
-    def stop_cmdctl(self):
-        self.cmdctl = False
-
-class TestStartStopProcessesBob(unittest.TestCase):
-    """
-    Check that the start_all_processes method starts the right combination
-    of processes and that the right processes are started and stopped
-    according to changes in configuration.
-    """
-    def check_started(self, bob, core, auth, resolver):
-        """
-        Check that the right sets of services are started. The ones that
-        should be running are specified by the core, auth and resolver parameters
-        (they are groups of processes, eg. auth means b10-auth, -xfrout, -xfrin
-        and -zonemgr).
-        """
-        self.assertEqual(bob.msgq, core)
-        self.assertEqual(bob.cfgmgr, core)
-        self.assertEqual(bob.ccsession, core)
-        self.assertEqual(bob.auth, auth)
-        self.assertEqual(bob.resolver, resolver)
-        self.assertEqual(bob.xfrout, auth)
-        self.assertEqual(bob.xfrin, auth)
-        self.assertEqual(bob.zonemgr, auth)
-        self.assertEqual(bob.stats, core)
-        self.assertEqual(bob.stats_httpd, core)
-        self.assertEqual(bob.cmdctl, core)
-
-    def check_preconditions(self, bob):
-        self.check_started(bob, False, False, False)
-
-    def check_started_none(self, bob):
-        """
-        Check that the situation is according to configuration where no servers
-        should be started. Some processes still need to be running.
-        """
-        self.check_started(bob, True, False, False)
-
-    def check_started_both(self, bob):
-        """
-        Check the situation is according to configuration where both servers
-        (auth and resolver) are enabled.
-        """
-        self.check_started(bob, True, True, True)
-
-    def check_started_auth(self, bob):
-        """
-        Check the set of processes needed to run auth only is started.
-        """
-        self.check_started(bob, True, True, False)
-
-    def check_started_resolver(self, bob):
-        """
-        Check the set of processes needed to run resolver only is started.
-        """
-        self.check_started(bob, True, False, True)
-
-    # Checks the processes started when starting neither auth nor resolver
-    # is specified.
-    def test_start_none(self):
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes and check what was started
-        bob.cfg_start_auth = False
-        bob.cfg_start_resolver = False
-
-        bob.start_all_processes()
-        self.check_started_none(bob)
-
-    # Checks the processes started when starting only the auth process
-    def test_start_auth(self):
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes and check what was started
-        bob.cfg_start_auth = True
-        bob.cfg_start_resolver = False
-
-        bob.start_all_processes()
-
-        self.check_started_auth(bob)
-
-    # Checks the processes started when starting only the resolver process
-    def test_start_resolver(self):
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes and check what was started
-        bob.cfg_start_auth = False
-        bob.cfg_start_resolver = True
-
-        bob.start_all_processes()
-
-        self.check_started_resolver(bob)
-
-    # Checks the processes started when starting both auth and resolver process
-    def test_start_both(self):
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes and check what was started
-        bob.cfg_start_auth = True
-        bob.cfg_start_resolver = True
-
-        bob.start_all_processes()
-
-        self.check_started_both(bob)
-
-    def test_config_start(self):
-        """
-        Test that the configuration starts and stops processes according
-        to configuration changes.
-        """
-
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes (nothing much should be started, as in
-        # test_start_none)
-        bob.cfg_start_auth = False
-        bob.cfg_start_resolver = False
-
-        bob.start_all_processes()
-        bob.runnable = True
-        self.check_started_none(bob)
-
-        # Enable both at once
-        bob.config_handler({'start_auth': True, 'start_resolver': True})
-        self.check_started_both(bob)
-
-        # Not touched by empty change
-        bob.config_handler({})
-        self.check_started_both(bob)
-
-        # Not touched by change to the same configuration
-        bob.config_handler({'start_auth': True, 'start_resolver': True})
-        self.check_started_both(bob)
-
-        # Turn them both off again
-        bob.config_handler({'start_auth': False, 'start_resolver': False})
-        self.check_started_none(bob)
-
-        # Not touched by empty change
-        bob.config_handler({})
-        self.check_started_none(bob)
-
-        # Not touched by change to the same configuration
-        bob.config_handler({'start_auth': False, 'start_resolver': False})
-        self.check_started_none(bob)
-
-        # Start and stop auth separately
-        bob.config_handler({'start_auth': True})
-        self.check_started_auth(bob)
-
-        bob.config_handler({'start_auth': False})
-        self.check_started_none(bob)
-
-        # Start and stop resolver separately
-        bob.config_handler({'start_resolver': True})
-        self.check_started_resolver(bob)
-
-        bob.config_handler({'start_resolver': False})
-        self.check_started_none(bob)
-
-        # Alternate
-        bob.config_handler({'start_auth': True})
-        self.check_started_auth(bob)
-
-        bob.config_handler({'start_auth': False, 'start_resolver': True})
-        self.check_started_resolver(bob)
-
-        bob.config_handler({'start_auth': True, 'start_resolver': False})
-        self.check_started_auth(bob)
-
-    def test_config_start_once(self):
-        """
-        Tests that a process is started only once.
-        """
-        # Create BoB and ensure correct initialization
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        # Start processes (both)
-        bob.cfg_start_auth = True
-        bob.cfg_start_resolver = True
-
-        bob.start_all_processes()
-        bob.runnable = True
-        self.check_started_both(bob)
-
-        bob.start_auth = lambda: self.fail("Started auth again")
-        bob.start_xfrout = lambda: self.fail("Started xfrout again")
-        bob.start_xfrin = lambda: self.fail("Started xfrin again")
-        bob.start_zonemgr = lambda: self.fail("Started zonemgr again")
-        bob.start_resolver = lambda: self.fail("Started resolver again")
-
-        # Send again we want to start them. Should not do it, as they are.
-        bob.config_handler({'start_auth': True})
-        bob.config_handler({'start_resolver': True})
-
-    def test_config_not_started_early(self):
-        """
-        Test that processes are not started by the config handler before
-        startup.
-        """
-        bob = StartStopCheckBob()
-        self.check_preconditions(bob)
-
-        bob.start_auth = lambda: self.fail("Started auth again")
-        bob.start_xfrout = lambda: self.fail("Started xfrout again")
-        bob.start_xfrin = lambda: self.fail("Started xfrin again")
-        bob.start_zonemgr = lambda: self.fail("Started zonemgr again")
-        bob.start_resolver = lambda: self.fail("Started resolver again")
-
-        bob.config_handler({'start_auth': True, 'start_resolver': True})
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
new file mode 100644
index 0000000..4d7b15c
--- /dev/null
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -0,0 +1,471 @@
+from bind10 import ProcessInfo, BoB, dump_pid, unlink_pid_file
+
+# XXX: environment tests are currently disabled, due to the preprocessor
+#      setup that we have now complicating the environment
+
+import unittest
+import sys
+import os
+import signal
+import socket
+from isc.net.addr import IPAddr
+
+class TestProcessInfo(unittest.TestCase):
+    def setUp(self):
+        # redirect stdout to a pipe so we can check that our
+        # process spawning is doing the right thing with stdout
+        self.old_stdout = os.dup(sys.stdout.fileno())
+        self.pipes = os.pipe()
+        os.dup2(self.pipes[1], sys.stdout.fileno())
+        os.close(self.pipes[1])
+        # note that we use dup2() to restore the original stdout
+        # to the main program ASAP in each test... this prevents
+        # hangs reading from the child process (as the pipe is only
+        # open in the child), and also insures nice pretty output
+
+    def tearDown(self):
+        # clean up our stdout munging
+        os.dup2(self.old_stdout, sys.stdout.fileno())
+        os.close(self.pipes[0])
+
+    def test_init(self):
+        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ])
+        os.dup2(self.old_stdout, sys.stdout.fileno())
+        self.assertEqual(pi.name, 'Test Process')
+        self.assertEqual(pi.args, [ '/bin/echo', 'foo' ])
+#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
+#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'] })
+        self.assertEqual(pi.dev_null_stdout, False)
+        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
+        self.assertNotEqual(pi.process, None)
+        self.assertTrue(type(pi.pid) is int)
+
+#    def test_setting_env(self):
+#        pi = ProcessInfo('Test Process', [ '/bin/true' ], env={'FOO': 'BAR'})
+#        os.dup2(self.old_stdout, sys.stdout.fileno())
+#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
+#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'],
+#                                   'FOO': 'BAR' })
+
+    def test_setting_null_stdout(self):
+        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ],
+                         dev_null_stdout=True)
+        os.dup2(self.old_stdout, sys.stdout.fileno())
+        self.assertEqual(pi.dev_null_stdout, True)
+        self.assertEqual(os.read(self.pipes[0], 100), b"")
+
+    def test_respawn(self):
+        pi = ProcessInfo('Test Process', [ '/bin/echo', 'foo' ])
+        # wait for old process to work...
+        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
+        # respawn it
+        old_pid = pi.pid
+        pi.respawn()
+        os.dup2(self.old_stdout, sys.stdout.fileno())
+        # make sure the new one started properly
+        self.assertEqual(pi.name, 'Test Process')
+        self.assertEqual(pi.args, [ '/bin/echo', 'foo' ])
+#        self.assertEqual(pi.env, { 'PATH': os.environ['PATH'],
+#                                   'PYTHON_EXEC': os.environ['PYTHON_EXEC'] })
+        self.assertEqual(pi.dev_null_stdout, False)
+        self.assertEqual(os.read(self.pipes[0], 100), b"foo\n")
+        self.assertNotEqual(pi.process, None)
+        self.assertTrue(type(pi.pid) is int)
+        self.assertNotEqual(pi.pid, old_pid)
+
+class TestBoB(unittest.TestCase):
+    def test_init(self):
+        bob = BoB()
+        self.assertEqual(bob.verbose, False)
+        self.assertEqual(bob.msgq_socket_file, None)
+        self.assertEqual(bob.cc_session, None)
+        self.assertEqual(bob.ccs, None)
+        self.assertEqual(bob.processes, {})
+        self.assertEqual(bob.dead_processes, {})
+        self.assertEqual(bob.runnable, False)
+        self.assertEqual(bob.uid, None)
+        self.assertEqual(bob.username, None)
+        self.assertEqual(bob.nocache, False)
+        self.assertEqual(bob.cfg_start_auth, True)
+        self.assertEqual(bob.cfg_start_resolver, False)
+
+    def test_init_alternate_socket(self):
+        bob = BoB("alt_socket_file")
+        self.assertEqual(bob.verbose, False)
+        self.assertEqual(bob.msgq_socket_file, "alt_socket_file")
+        self.assertEqual(bob.cc_session, None)
+        self.assertEqual(bob.ccs, None)
+        self.assertEqual(bob.processes, {})
+        self.assertEqual(bob.dead_processes, {})
+        self.assertEqual(bob.runnable, False)
+        self.assertEqual(bob.uid, None)
+        self.assertEqual(bob.username, None)
+        self.assertEqual(bob.nocache, False)
+        self.assertEqual(bob.cfg_start_auth, True)
+        self.assertEqual(bob.cfg_start_resolver, False)
+
+# Class for testing the BoB start/stop components routines.
+#
+# Although testing that external processes start is outside the scope
+# of the unit test, by overriding the process start methods we can check
+# that the right processes are started depending on the configuration
+# options.
+class StartStopCheckBob(BoB):
+    def __init__(self):
+        BoB.__init__(self)
+
+# Set flags as to which of the overridden methods has been run.
+        self.msgq = False
+        self.cfgmgr = False
+        self.ccsession = False
+        self.auth = False
+        self.resolver = False
+        self.xfrout = False
+        self.xfrin = False
+        self.zonemgr = False
+        self.stats = False
+        self.stats_httpd = False
+        self.cmdctl = False
+        self.c_channel_env = {}
+
+    def read_bind10_config(self):
+        # Configuration options are set directly
+        pass
+
+    def start_msgq(self, c_channel_env):
+        self.msgq = True
+
+    def start_cfgmgr(self, c_channel_env):
+        self.cfgmgr = True
+
+    def start_ccsession(self, c_channel_env):
+        self.ccsession = True
+
+    def start_auth(self, c_channel_env):
+        self.auth = True
+
+    def start_resolver(self, c_channel_env):
+        self.resolver = True
+
+    def start_xfrout(self, c_channel_env):
+        self.xfrout = True
+
+    def start_xfrin(self, c_channel_env):
+        self.xfrin = True
+
+    def start_zonemgr(self, c_channel_env):
+        self.zonemgr = True
+
+    def start_stats(self, c_channel_env):
+        self.stats = True
+
+    def start_stats_httpd(self, c_channel_env):
+        self.stats_httpd = True
+
+    def start_cmdctl(self, c_channel_env):
+        self.cmdctl = True
+
+    # We don't really use all of these stop_ methods. But it might turn out
+    # someone would add some stop_ method to BoB and we want that one overriden
+    # in case he forgets to update the tests.
+    def stop_msgq(self):
+        self.msgq = False
+
+    def stop_cfgmgr(self):
+        self.cfgmgr = False
+
+    def stop_ccsession(self):
+        self.ccsession = False
+
+    def stop_auth(self):
+        self.auth = False
+
+    def stop_resolver(self):
+        self.resolver = False
+
+    def stop_xfrout(self):
+        self.xfrout = False
+
+    def stop_xfrin(self):
+        self.xfrin = False
+
+    def stop_zonemgr(self):
+        self.zonemgr = False
+
+    def stop_stats(self):
+        self.stats = False
+
+    def stop_stats_httpd(self):
+        self.stats_httpd = False
+
+    def stop_cmdctl(self):
+        self.cmdctl = False
+
+class TestStartStopProcessesBob(unittest.TestCase):
+    """
+    Check that the start_all_processes method starts the right combination
+    of processes and that the right processes are started and stopped
+    according to changes in configuration.
+    """
+    def check_started(self, bob, core, auth, resolver):
+        """
+        Check that the right sets of services are started. The ones that
+        should be running are specified by the core, auth and resolver parameters
+        (they are groups of processes, eg. auth means b10-auth, -xfrout, -xfrin
+        and -zonemgr).
+        """
+        self.assertEqual(bob.msgq, core)
+        self.assertEqual(bob.cfgmgr, core)
+        self.assertEqual(bob.ccsession, core)
+        self.assertEqual(bob.auth, auth)
+        self.assertEqual(bob.resolver, resolver)
+        self.assertEqual(bob.xfrout, auth)
+        self.assertEqual(bob.xfrin, auth)
+        self.assertEqual(bob.zonemgr, auth)
+        self.assertEqual(bob.stats, core)
+        self.assertEqual(bob.stats_httpd, core)
+        self.assertEqual(bob.cmdctl, core)
+
+    def check_preconditions(self, bob):
+        self.check_started(bob, False, False, False)
+
+    def check_started_none(self, bob):
+        """
+        Check that the situation is according to configuration where no servers
+        should be started. Some processes still need to be running.
+        """
+        self.check_started(bob, True, False, False)
+
+    def check_started_both(self, bob):
+        """
+        Check the situation is according to configuration where both servers
+        (auth and resolver) are enabled.
+        """
+        self.check_started(bob, True, True, True)
+
+    def check_started_auth(self, bob):
+        """
+        Check the set of processes needed to run auth only is started.
+        """
+        self.check_started(bob, True, True, False)
+
+    def check_started_resolver(self, bob):
+        """
+        Check the set of processes needed to run resolver only is started.
+        """
+        self.check_started(bob, True, False, True)
+
+    # Checks the processes started when starting neither auth nor resolver
+    # is specified.
+    def test_start_none(self):
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes and check what was started
+        bob.cfg_start_auth = False
+        bob.cfg_start_resolver = False
+
+        bob.start_all_processes()
+        self.check_started_none(bob)
+
+    # Checks the processes started when starting only the auth process
+    def test_start_auth(self):
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes and check what was started
+        bob.cfg_start_auth = True
+        bob.cfg_start_resolver = False
+
+        bob.start_all_processes()
+
+        self.check_started_auth(bob)
+
+    # Checks the processes started when starting only the resolver process
+    def test_start_resolver(self):
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes and check what was started
+        bob.cfg_start_auth = False
+        bob.cfg_start_resolver = True
+
+        bob.start_all_processes()
+
+        self.check_started_resolver(bob)
+
+    # Checks the processes started when starting both auth and resolver process
+    def test_start_both(self):
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes and check what was started
+        bob.cfg_start_auth = True
+        bob.cfg_start_resolver = True
+
+        bob.start_all_processes()
+
+        self.check_started_both(bob)
+
+    def test_config_start(self):
+        """
+        Test that the configuration starts and stops processes according
+        to configuration changes.
+        """
+
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes (nothing much should be started, as in
+        # test_start_none)
+        bob.cfg_start_auth = False
+        bob.cfg_start_resolver = False
+
+        bob.start_all_processes()
+        bob.runnable = True
+        self.check_started_none(bob)
+
+        # Enable both at once
+        bob.config_handler({'start_auth': True, 'start_resolver': True})
+        self.check_started_both(bob)
+
+        # Not touched by empty change
+        bob.config_handler({})
+        self.check_started_both(bob)
+
+        # Not touched by change to the same configuration
+        bob.config_handler({'start_auth': True, 'start_resolver': True})
+        self.check_started_both(bob)
+
+        # Turn them both off again
+        bob.config_handler({'start_auth': False, 'start_resolver': False})
+        self.check_started_none(bob)
+
+        # Not touched by empty change
+        bob.config_handler({})
+        self.check_started_none(bob)
+
+        # Not touched by change to the same configuration
+        bob.config_handler({'start_auth': False, 'start_resolver': False})
+        self.check_started_none(bob)
+
+        # Start and stop auth separately
+        bob.config_handler({'start_auth': True})
+        self.check_started_auth(bob)
+
+        bob.config_handler({'start_auth': False})
+        self.check_started_none(bob)
+
+        # Start and stop resolver separately
+        bob.config_handler({'start_resolver': True})
+        self.check_started_resolver(bob)
+
+        bob.config_handler({'start_resolver': False})
+        self.check_started_none(bob)
+
+        # Alternate
+        bob.config_handler({'start_auth': True})
+        self.check_started_auth(bob)
+
+        bob.config_handler({'start_auth': False, 'start_resolver': True})
+        self.check_started_resolver(bob)
+
+        bob.config_handler({'start_auth': True, 'start_resolver': False})
+        self.check_started_auth(bob)
+
+    def test_config_start_once(self):
+        """
+        Tests that a process is started only once.
+        """
+        # Create BoB and ensure correct initialization
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        # Start processes (both)
+        bob.cfg_start_auth = True
+        bob.cfg_start_resolver = True
+
+        bob.start_all_processes()
+        bob.runnable = True
+        self.check_started_both(bob)
+
+        bob.start_auth = lambda: self.fail("Started auth again")
+        bob.start_xfrout = lambda: self.fail("Started xfrout again")
+        bob.start_xfrin = lambda: self.fail("Started xfrin again")
+        bob.start_zonemgr = lambda: self.fail("Started zonemgr again")
+        bob.start_resolver = lambda: self.fail("Started resolver again")
+
+        # Send again we want to start them. Should not do it, as they are.
+        bob.config_handler({'start_auth': True})
+        bob.config_handler({'start_resolver': True})
+
+    def test_config_not_started_early(self):
+        """
+        Test that processes are not started by the config handler before
+        startup.
+        """
+        bob = StartStopCheckBob()
+        self.check_preconditions(bob)
+
+        bob.start_auth = lambda: self.fail("Started auth again")
+        bob.start_xfrout = lambda: self.fail("Started xfrout again")
+        bob.start_xfrin = lambda: self.fail("Started xfrin again")
+        bob.start_zonemgr = lambda: self.fail("Started zonemgr again")
+        bob.start_resolver = lambda: self.fail("Started resolver again")
+
+        bob.config_handler({'start_auth': True, 'start_resolver': True})
+
+class TestPIDFile(unittest.TestCase):
+    def setUp(self):
+        self.pid_file = '@builddir@' + os.sep + 'bind10.pid'
+        if os.path.exists(self.pid_file):
+            os.unlink(self.pid_file)
+
+    def tearDown(self):
+        if os.path.exists(self.pid_file):
+            os.unlink(self.pid_file)
+
+    def check_pid_file(self):
+        # dump PID to the file, and confirm the content is correct
+        dump_pid(self.pid_file)
+        my_pid = os.getpid()
+        self.assertEqual(my_pid, int(open(self.pid_file, "r").read()))
+
+    def test_dump_pid(self):
+        self.check_pid_file()
+
+        # make sure any existing content will be removed
+        open(self.pid_file, "w").write('dummy data\n')
+        self.check_pid_file()
+
+    def test_unlink_pid_file_notexist(self):
+        dummy_data = 'dummy_data\n'
+        open(self.pid_file, "w").write(dummy_data)
+        unlink_pid_file("no_such_pid_file")
+        # the file specified for unlink_pid_file doesn't exist,
+        # and the original content of the file should be intact.
+        self.assertEqual(dummy_data, open(self.pid_file, "r").read())
+
+    def test_dump_pid_with_none(self):
+        # Check the behavior of dump_pid() and unlink_pid_file() with None.
+        # This should be no-op.
+        dump_pid(None)
+        self.assertFalse(os.path.exists(self.pid_file))
+
+        dummy_data = 'dummy_data\n'
+        open(self.pid_file, "w").write(dummy_data)
+        unlink_pid_file(None)
+        self.assertEqual(dummy_data, open(self.pid_file, "r").read())
+
+    def test_dump_pid_failure(self):
+        # the attempt to open file will fail, which should result in exception.
+        self.assertRaises(IOError, dump_pid,
+                          'nonexistent_dir' + os.sep + 'bind10.pid')
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/src/bin/cfgmgr/b10-cfgmgr.py.in b/src/bin/cfgmgr/b10-cfgmgr.py.in
index 659426d..e37ec48 100755
--- a/src/bin/cfgmgr/b10-cfgmgr.py.in
+++ b/src/bin/cfgmgr/b10-cfgmgr.py.in
@@ -26,10 +26,18 @@ import os
 isc.util.process.rename()
 
 # If B10_FROM_SOURCE is set in the environment, we use data files
-# from a directory relative to that, otherwise we use the ones
-# installed on the system
+# from a directory relative to the value of that variable, or, if defined,
+# relative to the value of B10_FROM_SOURCE_LOCALSTATEDIR.  Otherwise
+# we use the ones installed on the system.
+# B10_FROM_SOURCE_LOCALSTATEDIR is specifically intended to be used for
+# tests where we want to use variuos types of configuration within the test
+# environment.  (We may want to make it even more generic so that the path is
+# passed from the boss process)
 if "B10_FROM_SOURCE" in os.environ:
-    DATA_PATH = os.environ["B10_FROM_SOURCE"]
+    if "B10_FROM_SOURCE_LOCALSTATEDIR" in os.environ:
+        DATA_PATH = os.environ["B10_FROM_SOURCE_LOCALSTATEDIR"]
+    else:
+        DATA_PATH = os.environ["B10_FROM_SOURCE"]
 else:
     PREFIX = "@prefix@"
     DATA_PATH = "@localstatedir@/@PACKAGE@".replace("${prefix}", PREFIX)
diff --git a/src/bin/resolver/b10-resolver.8 b/src/bin/resolver/b10-resolver.8
index 3125e32..849092c 100644
--- a/src/bin/resolver/b10-resolver.8
+++ b/src/bin/resolver/b10-resolver.8
@@ -74,7 +74,7 @@ to listen on\&. The list items are the
 \fIaddress\fR
 string and
 \fIport\fR
-number\&. The defaults are address ::1 port 5300 and address 127\&.0\&.0\&.1 port 5300\&.
+number\&. The defaults are address ::1 port 53 and address 127\&.0\&.0\&.1 port 53\&.
 .PP
 
 \fIretries\fR
diff --git a/src/bin/resolver/b10-resolver.xml b/src/bin/resolver/b10-resolver.xml
index 0d395a7..bdf4f8a 100644
--- a/src/bin/resolver/b10-resolver.xml
+++ b/src/bin/resolver/b10-resolver.xml
@@ -141,8 +141,9 @@ once that is merged you can for instance do 'config add Resolver/forward_address
       <command>b10-resolver</command> to listen on.
       The list items are the <varname>address</varname> string
       and <varname>port</varname> number.
-      The defaults are address ::1 port 5300 and
-      address 127.0.0.1 port 5300.
+      The defaults are address ::1 port 53 and
+      address 127.0.0.1 port 53.
+<!-- TODO: but defaults are not used, Trac #518 -->
     </para>
 
     <para>
diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc
index 03f9ab7..d987c74 100644
--- a/src/bin/resolver/main.cc
+++ b/src/bin/resolver/main.cc
@@ -56,7 +56,6 @@ using namespace asiolink;
 
 namespace {
 
-// Default port current 5300 for testing purposes
 static const string PROGRAM = "Resolver";
 
 IOService io_service;
diff --git a/src/bin/resolver/resolver.spec.pre.in b/src/bin/resolver/resolver.spec.pre.in
index bc598b0..9df1e75 100644
--- a/src/bin/resolver/resolver.spec.pre.in
+++ b/src/bin/resolver/resolver.spec.pre.in
@@ -86,11 +86,11 @@
         "item_default": [
           {
             "address": "::1",
-            "port": 5300
+            "port": 53
           },
           {
             "address": "127.0.0.1",
-            "port": 5300
+            "port": 53
           }
         ],
         "list_item_spec": {
@@ -109,7 +109,7 @@
               "item_name": "port",
               "item_type": "integer",
               "item_optional": false,
-              "item_default": 5300
+              "item_default": 53
             }
           ]
         }
diff --git a/src/bin/stats/Makefile.am b/src/bin/stats/Makefile.am
index dedbb62..485bc05 100644
--- a/src/bin/stats/Makefile.am
+++ b/src/bin/stats/Makefile.am
@@ -8,9 +8,8 @@ b10_statsdir = $(pkgdatadir)
 b10_stats_DATA = stats.spec stats-httpd.spec
 b10_stats_DATA += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl
 
-CLEANFILES = b10-stats stats.pyc stats.spec
-CLEANFILES += b10-stats-httpd stats_httpd.pyc stats-httpd.spec
-CLEANFILES += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl
+CLEANFILES = b10-stats stats.pyc
+CLEANFILES += b10-stats-httpd stats_httpd.pyc
 
 man_MANS = b10-stats.8 b10-stats-httpd.8
 EXTRA_DIST = $(man_MANS) b10-stats.xml b10-stats-httpd.xml
diff --git a/src/bin/stats/run_b10-stats.sh.in b/src/bin/stats/run_b10-stats.sh.in
index 4bffd4c..5623082 100644
--- a/src/bin/stats/run_b10-stats.sh.in
+++ b/src/bin/stats/run_b10-stats.sh.in
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Copyright (C) 2010  Internet Systems Consortium.
+# Copyright (C) 2010, 2011  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
@@ -24,10 +24,10 @@ export PYTHONPATH
 BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
 export BIND10_MSGQ_SOCKET_FILE
 
-STATS_PATH=@abs_top_builddir@/src/bin/stats
-
 B10_FROM_SOURCE=@abs_top_srcdir@/src/bin/stats
 export B10_FROM_SOURCE
 
+STATS_PATH=@abs_top_builddir@/src/bin/stats
+
 cd ${STATS_PATH}
 exec ${PYTHON_EXEC} -O b10-stats "$@"
diff --git a/src/bin/stats/stats.py.in b/src/bin/stats/stats.py.in
old mode 100755
new mode 100644
diff --git a/src/bin/stats/tests/b10-stats-httpd_test.py b/src/bin/stats/tests/b10-stats-httpd_test.py
index 0b1ec18..24659af 100644
--- a/src/bin/stats/tests/b10-stats-httpd_test.py
+++ b/src/bin/stats/tests/b10-stats-httpd_test.py
@@ -250,13 +250,12 @@ class TestStatsHttpd(unittest.TestCase):
     def test_load_config(self):
         self.stats_httpd.load_config()
         self.assertTrue(('127.0.0.1', 8000) in set(self.stats_httpd.http_addrs))
-        self.assertTrue(('::1', 8000) in set(self.stats_httpd.http_addrs))
 
     def test_httpd(self):
         # dual stack (addresses is ipv4 and ipv6)
         socket.has_ipv6 = True
         self.assertTrue(('127.0.0.1', 8000) in set(self.stats_httpd.http_addrs))
-        self.assertTrue(('::1', 8000) in set(self.stats_httpd.http_addrs))
+        self.stats_httpd.http_addrs = [ ('::1', 8000), ('127.0.0.1', 8000) ]
         self.assertTrue(
             stats_httpd.HttpServer.address_family in set([socket.AF_INET, socket.AF_INET6]))
         self.stats_httpd.open_httpd()
diff --git a/src/bin/stats/tests/stats_test.in b/src/bin/stats/tests/stats_test.in
index 02b2880..39b5a94 100644
--- a/src/bin/stats/tests/stats_test.in
+++ b/src/bin/stats/tests/stats_test.in
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Copyright (C) 2010-2011  Internet Systems Consortium.
+# Copyright (C) 2010, 2011  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
@@ -21,11 +21,11 @@ export PYTHON_EXEC
 PYTHONPATH=@abs_top_builddir@/src/lib/python:@abs_top_srcdir@/src/bin/stats:@abs_top_srcdir@/src/bin/stats/tests
 export PYTHONPATH
 
-TEST_PATH=@abs_top_srcdir@/src/bin/stats/tests
-
 B10_FROM_SOURCE=@abs_top_srcdir@/src/bin/stats
 export B10_FROM_SOURCE
 
+TEST_PATH=@abs_top_srcdir@/src/bin/stats/tests
+
 cd ${TEST_PATH}
 ${PYTHON_EXEC} -O b10-stats_test.py $*
 ${PYTHON_EXEC} -O b10-stats-httpd_test.py $*
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index fd1288d..f420d4b 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -50,7 +50,11 @@ isc.util.process.rename()
 if "B10_FROM_BUILD" in os.environ:
     SPECFILE_PATH = os.environ["B10_FROM_BUILD"] + "/src/bin/xfrout"
     AUTH_SPECFILE_PATH = os.environ["B10_FROM_BUILD"] + "/src/bin/auth"
-    UNIX_SOCKET_FILE= os.environ["B10_FROM_BUILD"] + "/auth_xfrout_conn"
+    if "B10_FROM_SOURCE_LOCALSTATEDIR" in os.environ:
+        UNIX_SOCKET_FILE = os.environ["B10_FROM_SOURCE_LOCALSTATEDIR"] + \
+            "/auth_xfrout_conn"
+    else:
+        UNIX_SOCKET_FILE = os.environ["B10_FROM_BUILD"] + "/auth_xfrout_conn"
 else:
     PREFIX = "@prefix@"
     DATAROOTDIR = "@datarootdir@"
diff --git a/src/lib/asiolink/Makefile.am b/src/lib/asiolink/Makefile.am
index b3968f0..b0ce027 100644
--- a/src/lib/asiolink/Makefile.am
+++ b/src/lib/asiolink/Makefile.am
@@ -35,6 +35,7 @@ libasiolink_la_SOURCES += tcp_socket.h
 libasiolink_la_SOURCES += udp_endpoint.h
 libasiolink_la_SOURCES += udp_server.h udp_server.cc
 libasiolink_la_SOURCES += udp_socket.h
+libasiolink_la_SOURCES += qid_gen.cc qid_gen.h
 # Note: the ordering matters: -Wno-... must follow -Wextra (defined in
 # B10_CXXFLAGS)
 libasiolink_la_CXXFLAGS = $(AM_CXXFLAGS)
diff --git a/src/lib/asiolink/io_fetch.cc b/src/lib/asiolink/io_fetch.cc
index d1f722c..a68c4c5 100644
--- a/src/lib/asiolink/io_fetch.cc
+++ b/src/lib/asiolink/io_fetch.cc
@@ -26,6 +26,8 @@
 #include <dns/rcode.h>
 #include <log/dummylog.h>
 
+#include <asiolink/qid_gen.h>
+
 #include <asio.hpp>
 #include <asiolink/io_fetch.h>
 
@@ -34,8 +36,9 @@ using namespace isc::dns;
 using namespace isc::log;
 using namespace std;
 
-namespace asiolink {
 
+
+namespace asiolink {
 /// IOFetch Constructor - just initialize the private data
 
 IOFetch::IOFetch(int protocol, IOService& service,
@@ -64,8 +67,7 @@ IOFetch::operator()(error_code ec, size_t length) {
         {
             Message msg(Message::RENDER);
             
-            // TODO: replace with boost::random or some other suitable PRNG
-            msg.setQid(0);
+            msg.setQid(QidGenerator::getInstance().generateQid());
             msg.setOpcode(Opcode::QUERY());
             msg.setRcode(Rcode::NOERROR());
             msg.setHeaderFlag(Message::HEADERFLAG_RD);
diff --git a/src/lib/asiolink/qid_gen.cc b/src/lib/asiolink/qid_gen.cc
new file mode 100644
index 0000000..4063b39
--- /dev/null
+++ b/src/lib/asiolink/qid_gen.cc
@@ -0,0 +1,54 @@
+// Copyright (C) 2011  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.
+
+// qid_gen defines a generator for query id's
+//
+// We probably want to merge this with the weighted random in the nsas
+// (and other parts where we need randomness, perhaps another thing
+// for a general libutil?)
+
+#include <asiolink/qid_gen.h>
+
+#include <sys/time.h>
+
+namespace {
+    asiolink::QidGenerator qid_generator_instance;
+}
+
+namespace asiolink {
+
+QidGenerator&
+QidGenerator::getInstance() {
+    return (qid_generator_instance);
+}
+
+QidGenerator::QidGenerator() : dist_(0, 65535),
+                               vgen_(generator_, dist_)
+{
+    seed();
+}
+
+void
+QidGenerator::seed() {
+    struct timeval tv;
+    gettimeofday(&tv, 0);
+    generator_.seed((tv.tv_sec * 1000000) + tv.tv_usec);
+}
+
+isc::dns::qid_t
+QidGenerator::generateQid() {
+    return (vgen_());
+}
+
+} // namespace asiolink
diff --git a/src/lib/asiolink/qid_gen.h b/src/lib/asiolink/qid_gen.h
new file mode 100644
index 0000000..a5caa17
--- /dev/null
+++ b/src/lib/asiolink/qid_gen.h
@@ -0,0 +1,85 @@
+// Copyright (C) 2011  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.
+
+// qid_gen defines a generator for query id's
+//
+// We probably want to merge this with the weighted random in the nsas
+// (and other parts where we need randomness, perhaps another thing
+// for a general libutil?)
+
+#ifndef __QID_GEN_H
+#define __QID_GEN_H
+
+#include <dns/message.h>
+#include <boost/random/mersenne_twister.hpp>
+#include <boost/random/uniform_int.hpp>
+#include <boost/random/variate_generator.hpp>
+
+
+namespace asiolink {
+
+/// This class generates Qids for outgoing queries
+///
+/// It is implemented as a singleton; the public way to access it
+/// is to call getInstance()->generateQid().
+///
+/// It automatically seeds it with the current time when it is first
+/// used.
+class QidGenerator {
+public:
+    /// \brief Returns the singleton instance of the QidGenerator
+    ///
+    /// Returns a reference to the singleton instance of the generator
+    static QidGenerator& getInstance();
+
+    /// \brief Default constructor
+    ///
+    /// It is recommended that getInstance is used rather than creating
+    /// separate instances of this class.
+    ///
+    /// The constructor automatically seeds the generator with the
+    /// current time.
+    QidGenerator();
+
+    /// Generate a Qid
+    ///
+    /// \return A random Qid
+    isc::dns::qid_t generateQid();
+
+    /// \brief Seeds the QidGenerator (based on the current time)
+    ///
+    /// This is automatically called by the constructor
+    void seed();
+
+private:
+    // "Mersenne Twister: A 623-dimensionally equidistributed
+    // uniform pseudo-random number generator", Makoto Matsumoto and
+    // Takuji Nishimura, ACM Transactions on Modeling and Computer
+    // Simulation: Special Issue on Uniform Random Number Generation,
+    // Vol. 8, No. 1, January 1998, pp. 3-30.
+    //
+    // mt19937 is an implementation of one of the pseudo random
+    // generators described in this paper.
+    boost::mt19937 generator_;
+
+    // For qid's we want a uniform distribution
+    boost::uniform_int<> dist_;
+
+    boost::variate_generator<boost::mt19937&, boost::uniform_int<> > vgen_;
+};
+
+
+} // namespace asiolink
+
+#endif // __QID_GEN_H
diff --git a/src/lib/asiolink/tests/Makefile.am b/src/lib/asiolink/tests/Makefile.am
index b4f0a87..ba5d962 100644
--- a/src/lib/asiolink/tests/Makefile.am
+++ b/src/lib/asiolink/tests/Makefile.am
@@ -27,6 +27,7 @@ run_unittests_SOURCES += interval_timer_unittest.cc
 run_unittests_SOURCES += recursive_query_unittest.cc
 run_unittests_SOURCES += udp_endpoint_unittest.cc
 run_unittests_SOURCES += udp_socket_unittest.cc
+run_unittests_SOURCES += qid_gen_unittest.cc
 
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 
diff --git a/src/lib/asiolink/tests/qid_gen_unittest.cc b/src/lib/asiolink/tests/qid_gen_unittest.cc
new file mode 100644
index 0000000..3ad8a03
--- /dev/null
+++ b/src/lib/asiolink/tests/qid_gen_unittest.cc
@@ -0,0 +1,59 @@
+// Copyright (C) 2011  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.
+
+// Copyright (C) 2011  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.
+
+
+/// \brief Test of QidGenerator
+///
+
+#include <gtest/gtest.h>
+
+#include <asiolink/qid_gen.h>
+#include <dns/message.h>
+
+// Tests the operation of the Qid generator
+
+// Check that getInstance returns a singleton
+TEST(QidGenerator, singleton) {
+    asiolink::QidGenerator& g1 = asiolink::QidGenerator::getInstance();
+    asiolink::QidGenerator& g2 = asiolink::QidGenerator::getInstance();
+
+    EXPECT_TRUE(&g1 == &g2);
+}
+
+TEST(QidGenerator, generate) {
+    // We'll assume that boost's generator is 'good enough', and won't
+    // do full statistical checking here. Let's just call it the xkcd
+    // test (http://xkcd.com/221/), and check if three consecutive
+    // generates are not all the same.
+    isc::dns::qid_t one, two, three;
+    asiolink::QidGenerator& gen = asiolink::QidGenerator::getInstance();
+    one = gen.generateQid();
+    two = gen.generateQid();
+    three = gen.generateQid();
+    ASSERT_FALSE((one == two) && (one == three));
+}
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..d4008c0
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = system
diff --git a/tests/system/Makefile.am b/tests/system/Makefile.am
new file mode 100644
index 0000000..efd5d7f
--- /dev/null
+++ b/tests/system/Makefile.am
@@ -0,0 +1,13 @@
+systest:
+	sh $(srcdir)/runall.sh
+
+distclean-local:
+	sh $(srcdir)/cleanall.sh
+
+# Most of the files under this directory (including test subdirectories)
+# must be listed in EXTRA_DIST.
+EXTRA_DIST = README cleanall.sh ifconfig.sh start.pl stop.pl run.sh runall.sh
+EXTRA_DIST += glue/auth.good glue/example.good glue/noglue.good glue/test.good
+EXTRA_DIST += glue/tests.sh glue/clean.sh
+EXTRA_DIST += glue/nsx1/com.db glue/nsx1/net.db glue/nsx1/root-servers.nil.db
+EXTRA_DIST += glue/nsx1/root.db
diff --git a/tests/system/README b/tests/system/README
new file mode 100644
index 0000000..080652d
--- /dev/null
+++ b/tests/system/README
@@ -0,0 +1,62 @@
+Copyright (C) 2004, 2010, 2011  Internet Systems Consortium, Inc. ("ISC")
+Copyright (C) 2000, 2001  Internet Software Consortium.
+See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
+
+This is a simple test environment for running BIND 10 system tests
+involving multiple name servers.  It was originally developed for BIND
+9, and has been ported to test BIND 10 implementations.  Ideally we
+should share the same framework for both versions, so some part of
+the original setup are kept, even though they are BIND 9 specific and
+not currently used.
+
+Also, these tests generally rely on BIND 9 programs, most commonly its
+dig, and will sometimes be its name server (named).  So, the test
+environment assumes that there's a source tree of BIND 9 where its
+programs are built, and that an environment variable "BIND9_TOP" is
+set to point to the top directory of the source tree.
+
+There are multiple test suites, each in a separate subdirectory and
+involving a different DNS setup.  They are:
+
+  glue/		Glue handling tests
+(the following tests are planned to be added soon)
+  dnssec/	DNSSEC tests
+  masterfile/	Master file parser
+  xfer/		Zone transfer tests
+
+Typically each test suite sets up 2-5 instances of BIND 10 (or BIND 9
+named) and then performs one or more tests against them.  Within the
+test suite subdirectory, each instance has a separate subdirectory
+containing its configuration data.  By convention, these
+subdirectories are named "nsx1", "nsx2", etc for BIND 10 ("x" means
+BIND 10), and "ns1", "ns2", etc. for BIND 9.
+
+The tests are completely self-contained and do not require access to
+the real DNS.  Generally, one of the test servers (ns[x]1) is set up
+as a root name server and is listed in the hints file of the others.
+
+To enable all servers to run on the same machine, they bind to
+separate virtual IP address on the loopback interface.  ns[x]1 runs on
+10.53.0.1, ns[x]2 on 10.53.0.2, etc.  Before running any tests, you
+must set up these addresses by running "ifconfig.sh up" as root.
+
+Mac OS X:
+If you wish to make the interfaces survive across reboots
+copy org.isc.bind.system and org.isc.bind.system to
+/Library/LaunchDaemons then run
+"launchctl load /Library/LaunchDaemons/org.isc.bind.system.plist" as
+root.
+
+The servers use port 53210 instead of the usual port 53, so they can be
+run without root privileges once the interfaces have been set up.
+
+The tests can be run individually like this:
+
+  sh run.sh xfer
+  sh run.sh glue
+  etc.
+
+To run all the tests, just type "make systest" either on this directory
+or on the top source directory.  Note: currently these tests cannot be
+run when built under a separate build directory.  Everything must be
+run within the original source tree.
diff --git a/tests/system/cleanall.sh b/tests/system/cleanall.sh
new file mode 100755
index 0000000..17c3d4a
--- /dev/null
+++ b/tests/system/cleanall.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000, 2001  Internet Software Consortium.
+#
+# 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.
+
+#
+# Clean up after system tests.
+#
+
+find . -type f \( \
+    -name 'K*' -o -name '*~' -o -name '*.core' -o -name '*.log' \
+    -o -name '*.pid' -o -name '*.keyset' -o -name named.run \
+    -o -name bind10.run -o -name lwresd.run -o -name ans.run \) -print | \
+    xargs rm -f
+
+status=0
+
+for d in `find . -type d -maxdepth 1 -mindepth 1 -print`
+do
+   test ! -f $d/clean.sh || ( cd $d && sh clean.sh )
+done
diff --git a/tests/system/conf.sh.in b/tests/system/conf.sh.in
new file mode 100755
index 0000000..29d959a
--- /dev/null
+++ b/tests/system/conf.sh.in
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Copyright (C) 2004-2011  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000-2003  Internet Software Consortium.
+#
+# 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.
+
+#
+# Common configuration data for system tests, to be sourced into
+# other shell scripts.
+#
+
+# Prerequisite check
+if [ @srcdir@ != @builddir@ ]; then
+	echo "Currently systest doesn't work for a separate build tree."
+	echo "Rebuild BIND 10 on the source tree and run the tests."
+	exit 1
+fi
+
+if [ -z $BIND9_TOP ]; then
+	echo "systest assumes there's a compiled tree of BIND 9 which can be"
+	echo "accessed via the BIND9_TOP environment variable."
+	echo "Please make sure this assumption is met."
+	exit 1
+fi
+
+# Find the top of the source tree.
+TOP=@abs_top_srcdir@
+
+RUN_BIND10=$TOP/src/bin/bind10/run_bind10.sh
+B10_LOADZONE=$TOP/src/bin/loadzone/run_loadzone.sh
+BIND9_NAMED=$BIND9_TOP/bin/named/named
+DIG=$BIND9_TOP/bin/dig/dig
+# Test tools borrowed from BIND 9's system test (without change).
+TESTSOCK=$BIND9_TOP/bin/tests/system/testsock.pl
+DIGCOMP=$BIND9_TOP/bin/tests/system/digcomp.pl
+
+SUBDIRS="glue"
+#SUBDIRS="dnssec glue masterfile xfer"
+
+# PERL will be an empty string if no perl interpreter was found.
+PERL=@PERL@
+
+export RUN_BIND10 BIND9_NAMED DIG SUBDIRS PERL TESTSOCK
diff --git a/tests/system/glue/auth.good b/tests/system/glue/auth.good
new file mode 100644
index 0000000..2c619f6
--- /dev/null
+++ b/tests/system/glue/auth.good
@@ -0,0 +1,15 @@
+
+; <<>> DiG 9.0 <<>> +norec @10.53.0.1 -p 5300 foo.bar.example.org. a
+;; global options:  printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41239
+;; flags: qr ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
+
+;; QUESTION SECTION:
+;foo.bar.example.org.			IN	A
+
+;; AUTHORITY SECTION:
+example.org.		172800	IN	NS	b.root-servers.nil.
+
+;; ADDITIONAL SECTION:
+b.root-servers.nil.	300	IN	A	10.53.0.2
diff --git a/tests/system/glue/clean.sh b/tests/system/glue/clean.sh
new file mode 100755
index 0000000..b2c1e02
--- /dev/null
+++ b/tests/system/glue/clean.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000, 2001  Internet Software Consortium.
+#
+# 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.
+
+#
+# Clean up after glue tests.
+#
+
+rm -f dig.out.*
+rm -f */msgq_socket */zone.sqlite3
diff --git a/tests/system/glue/example.good b/tests/system/glue/example.good
new file mode 100644
index 0000000..3b7bbb8
--- /dev/null
+++ b/tests/system/glue/example.good
@@ -0,0 +1,19 @@
+
+; <<>> DiG 9.0 <<>> +norec @10.53.0.1 -p 5300 foo.bar.example. A
+;; global options:  printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58772
+;; flags: qr ad; QUERY: 1, ANSWER: 0, AUTHORITY: 6, ADDITIONAL: 7
+
+;; QUESTION SECTION:
+;foo.bar.example.			IN	A
+
+;; AUTHORITY SECTION:
+example.			172800	IN	NS	NS1.example.COM.
+example.			172800	IN	NS	NS.example.
+
+;; ADDITIONAL SECTION:
+NS.example.		172800	IN	A	192.0.2.1
+NS.example.		172800	IN	A	192.0.2.2
+NS1.example.COM.	172800	IN	A	192.0.2.101
+NS1.example.COM.		172800	IN	AAAA	2001:db8::1
diff --git a/tests/system/glue/noglue.good b/tests/system/glue/noglue.good
new file mode 100644
index 0000000..57a2211
--- /dev/null
+++ b/tests/system/glue/noglue.good
@@ -0,0 +1,14 @@
+
+; <<>> DiG 9.0 <<>> @10.53.0.1 -p 5300 example.net a
+;; global options:  printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29409
+;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 0
+
+;; QUESTION SECTION:
+;example.net.			IN	A
+
+;; AUTHORITY SECTION:
+example.net.		300	IN	NS	ns2.example.info.
+example.net.		300	IN	NS	ns1.example.info.
+
diff --git a/tests/system/glue/nsx1/b10-config.db.in b/tests/system/glue/nsx1/b10-config.db.in
new file mode 100644
index 0000000..acd040c
--- /dev/null
+++ b/tests/system/glue/nsx1/b10-config.db.in
@@ -0,0 +1,9 @@
+{"version": 2,
+ "Auth": {
+   "listen_on": [{"address": "10.53.0.1", "port": 53210}],
+   "database_file": "@abs_builddir@/zone.sqlite3"
+ },
+ "Xfrout": {
+   "log_file": "@abs_builddir@/Xfrout.log"
+ }
+}
diff --git a/tests/system/glue/nsx1/com.db b/tests/system/glue/nsx1/com.db
new file mode 100644
index 0000000..c4b94e1
--- /dev/null
+++ b/tests/system/glue/nsx1/com.db
@@ -0,0 +1,31 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; 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.
+
+$ORIGIN com.
+$TTL 300
+@ 			IN SOA	root.example.com. a.root.servers.nil. (
+				2000042100   	; serial
+				600         	; refresh
+				600         	; retry
+				1200    	; expire
+				600       	; minimum
+				)
+@			NS	a.root-servers.nil.
+
+example.com.			NS	ns1.example.com.
+example.com.			NS	ns2.example.com.
+ns1.example.com.		172800	IN	A	192.0.2.101
+ns1.example.com.		172800	IN	AAAA	2001:db8::1
+ns2.example.com.		172800	IN	A	192.0.2.102
diff --git a/tests/system/glue/nsx1/net.db b/tests/system/glue/nsx1/net.db
new file mode 100644
index 0000000..8b66521
--- /dev/null
+++ b/tests/system/glue/nsx1/net.db
@@ -0,0 +1,32 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; 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.
+
+$ORIGIN net.
+$TTL 300
+@ 			IN SOA	root.example.net. a.root.servers.nil. (
+				2000042100   	; serial
+				600         	; refresh
+				600         	; retry
+				1200    	; expire
+				600       	; minimum
+				)
+@			NS	a.root-servers.nil.
+
+; Referral outside of server authority, but with glue records present.
+; Don't hand out the glue.
+example.net.			NS	ns1.example.info.
+example.net.			NS	ns2.example.info.
+ns1.example.info.	172800	IN	A	192.0.2.101
+ns2.example.info.	172800	IN	A	192.0.2.102
diff --git a/tests/system/glue/nsx1/root-servers.nil.db b/tests/system/glue/nsx1/root-servers.nil.db
new file mode 100644
index 0000000..45050a9
--- /dev/null
+++ b/tests/system/glue/nsx1/root-servers.nil.db
@@ -0,0 +1,26 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; 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.
+
+$TTL 300
+@			IN SOA	ns hostmaster (
+				1
+				3600
+				1800
+				1814400
+				3600
+				)
+			NS	a
+a			A	10.53.0.1
+b			A	10.53.0.2
diff --git a/tests/system/glue/nsx1/root.db b/tests/system/glue/nsx1/root.db
new file mode 100644
index 0000000..e43f2d2
--- /dev/null
+++ b/tests/system/glue/nsx1/root.db
@@ -0,0 +1,55 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; 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.
+
+$TTL 300
+. 			IN SOA	postmaster.example. a.root.servers.nil. (
+				2000042100   	; serial
+				600         	; refresh
+				600         	; retry
+				1200    	; expire
+				600       	; minimum
+				)
+.			NS	a.root-servers.nil.
+
+root-servers.nil.	NS	a.root-servers.nil.
+a.root-servers.nil.	A	10.53.0.1
+
+; Delegate some domains that contain name servers for the sample
+; ccTLDs below.
+com.			172800	IN	NS	a.root-servers.nil.
+
+;
+; A sample TLD
+;
+example.			172800	IN	NS	NS.example.
+example.			172800	IN	NS	NS1.example.COM.
+NS.example.			172800	IN	A	192.0.2.1
+NS.example.			172800	IN	A	192.0.2.2
+; this "glue" is below a zone cut for com.  BIND 9 still uses it for
+; the delegation to example.  BIND 10 (with sqlite3 data source) doesn't.
+NS1.example.COM.		172800	IN	A	192.0.2.3
+
+;
+;
+;
+test.				172800	IN	NS	ns.test.
+test.				172800	IN	NS	ns1.example.net.
+ns.test.			172800	IN	A	192.0.2.200
+ns1.example.net.		172800	IN	A	192.0.2.201
+
+;
+; A hypothetical ccTLD where we are authoritative for the NS glue.
+;
+example.org		172800  IN      NS      b.root-servers.nil.
diff --git a/tests/system/glue/setup.sh.in b/tests/system/glue/setup.sh.in
new file mode 100755
index 0000000..dc5b28a
--- /dev/null
+++ b/tests/system/glue/setup.sh.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (C) 2011  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.
+
+SYSTEMTESTTOP=..
+. $SYSTEMTESTTOP/conf.sh
+
+rm -f */zone.sqlite3
+${B10_LOADZONE} -o . -d @builddir@/nsx1/zone.sqlite3 @builddir@/nsx1/root.db
+${B10_LOADZONE} -o root-servers.nil -d @builddir@/nsx1/zone.sqlite3 \
+	@builddir@/nsx1/root-servers.nil.db
+${B10_LOADZONE} -o com -d @builddir@/nsx1/zone.sqlite3 @builddir@/nsx1/com.db
+${B10_LOADZONE} -o net -d @builddir@/nsx1/zone.sqlite3 @builddir@/nsx1/net.db
diff --git a/tests/system/glue/test.good b/tests/system/glue/test.good
new file mode 100644
index 0000000..b9b4719
--- /dev/null
+++ b/tests/system/glue/test.good
@@ -0,0 +1,19 @@
+
+; <<>> DiG 9.8.0 <<>> @127.0.0.1 -p 5300 foo.bar.test
+; (1 server found)
+;; global options: +cmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55069
+;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 2
+;; WARNING: recursion requested but not available
+
+;; QUESTION SECTION:
+;foo.bar.test.			IN	A
+
+;; AUTHORITY SECTION:
+test.			172800	IN	NS	ns.test.
+test.			172800	IN	NS	ns1.example.net.
+
+;; ADDITIONAL SECTION:
+ns.test.		172800	IN	A	192.0.2.200
+ns1.example.net.	172800	IN	A	192.0.2.201
diff --git a/tests/system/glue/tests.sh b/tests/system/glue/tests.sh
new file mode 100755
index 0000000..50b2330
--- /dev/null
+++ b/tests/system/glue/tests.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000, 2001, 2003  Internet Software Consortium.
+#
+# 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.
+
+SYSTEMTESTTOP=..
+. $SYSTEMTESTTOP/conf.sh
+
+#
+# Do glue tests.
+#
+
+status=0
+n=0
+
+# This query should result in a delegation with two NS; one in the delegated
+# zone and one in a so called out-of-bailiwick zone for which the auth server
+# has authority, too.  For the former, the server should return glue in the
+# parent zone.  For the latter, BIND 9 and BIND 10 behave differently; BIND 9
+# uses "glue" in the parent zone (since this is the root zone everything can
+# be considered a valid glue).  BIND 10 (using sqlite3 data source) searches
+# the other zone and uses the authoritative data in that zone (which is
+# intentionally different from the glue in the root zone).
+echo "I:testing that a TLD referral gets a full glue set from the root zone ($n)"
+$DIG +norec @10.53.0.1 -p 53210 foo.bar.example. A >dig.out.$n || status=1
+$PERL $DIGCOMP example.good dig.out.$n || status=1
+n=`expr $n + 1`
+
+echo "I:testing that we find glue A RRs we are authoritative for ($n)"
+$DIG +norec @10.53.0.1 -p 53210 foo.bar.example.org. a >dig.out.$n || status=1
+$PERL $DIGCOMP auth.good dig.out.$n || status=1
+n=`expr $n + 1`
+
+# We cannot do this test for BIND 10 because b10-auth doesn't act as a
+# recursive (caching) server (by design)
+# echo "I:testing that we find glue A/AAAA RRs in the cache ($n)"
+# $DIG +norec @10.53.0.1 -p 53210 foo.bar.yy. a >dig.out.$n || status=1
+# $PERL $DIGCOMP yy.good dig.out.$n || status=1
+# n=`expr $n + 1`
+
+echo "I:testing that we don't find out-of-zone glue ($n)"
+$DIG +norec @10.53.0.1 -p 53210 example.net. a > dig.out.$n || status=1
+$PERL $DIGCOMP noglue.good dig.out.$n || status=1
+n=`expr $n + 1`
+
+# This test currently fails (additional section will be empty, which is
+# incorrect).  See Trac ticket #646.
+#echo "I:testing that we are finding partial out-of-zone glue ($n)"
+#$DIG +norec @10.53.0.1 -p 53210 foo.bar.test. a >dig.out.$n || status=1
+#$PERL $DIGCOMP test.good dig.out.$n || status=1
+#n=`expr $n + 1`
+
+echo "I:exit status: $status"
+exit $status
diff --git a/tests/system/ifconfig.sh b/tests/system/ifconfig.sh
new file mode 100755
index 0000000..c0c365a
--- /dev/null
+++ b/tests/system/ifconfig.sh
@@ -0,0 +1,226 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007-2010  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000-2003  Internet Software Consortium.
+#
+# 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.
+
+#
+# Set up interface aliases for bind9 system tests.
+#
+# IPv4: 10.53.0.{1..7}				RFC 1918
+# IPv6: fd92:7065:b8e:ffff::{1..7}		ULA
+#
+
+config_guess=""
+for f in ./config.guess ../../config.guess
+do
+	if test -f $f
+	then
+		config_guess=$f
+	fi
+done
+
+if test "X$config_guess" = "X"
+then
+	cat <<EOF >&2
+$0: must be run from the top level source directory or the
+bin/tests/system directory
+EOF
+	exit 1
+fi
+
+# If running on hp-ux, don't even try to run config.guess.
+# It will try to create a temporary file in the current directory,
+# which fails when running as root with the current directory
+# on a NFS mounted disk.
+
+case `uname -a` in
+  *HP-UX*) sys=hpux ;;
+  *) sys=`sh $config_guess` ;;
+esac
+
+case "$2" in
+[0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base=$2;;
+*) base=""
+esac
+
+case "$3" in
+[0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base6=$2;;
+*) base6=""
+esac
+
+case "$1" in
+
+    start|up)
+	for ns in 1 2 3 4 5 6 7
+	do
+		if test -n "$base"
+		then
+			int=`expr $ns + $base - 1`
+		else
+			int=$ns
+		fi
+		if test -n "$base6"
+		then
+			int6=`expr $ns + $base6 - 1`
+		else
+			int6=$ns
+		fi
+		case "$sys" in
+		    *-pc-solaris2.5.1)
+			ifconfig lo0:$int 10.53.0.$ns netmask 0xffffffff up
+			;;
+		    *-sun-solaris2.[6-7])
+			ifconfig lo0:$int 10.53.0.$ns netmask 0xffffffff up
+			;;
+		    *-*-solaris2.[8-9]|*-*-solaris2.1[0-9])
+			/sbin/ifconfig lo0:$int plumb
+			/sbin/ifconfig lo0:$int 10.53.0.$ns up
+			if test -n "$int6"
+			then
+				/sbin/ifconfig lo0:$int6 inet6 plumb
+				/sbin/ifconfig lo0:$int6 \
+					inet6 fd92:7065:b8e:ffff::$ns up
+			fi
+			;;
+		    *-*-linux*)
+			ifconfig lo:$int 10.53.0.$ns up netmask 255.255.255.0
+			ifconfig lo inet6 add fd92:7065:b8e:ffff::$ns/64
+		        ;;
+		    *-unknown-freebsd*)
+			ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
+			;;
+		    *-unknown-netbsd*)
+			ifconfig lo0 10.53.0.$ns alias netmask 255.255.255.0
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
+			;;
+		    *-unknown-openbsd*)
+			ifconfig lo0 10.53.0.$ns alias netmask 255.255.255.0
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
+			;;
+		    *-*-bsdi[3-5].*)
+			ifconfig lo0 add 10.53.0.$ns netmask 255.255.255.0
+			;;
+		    *-dec-osf[4-5].*)
+			ifconfig lo0 alias 10.53.0.$ns
+			;;
+		    *-sgi-irix6.*)
+			ifconfig lo0 alias 10.53.0.$ns
+			;;
+		    *-*-sysv5uw7*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+			ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff
+			;;
+		    *-ibm-aix4.*|*-ibm-aix5.*)
+			ifconfig lo0 alias 10.53.0.$ns
+			ifconfig lo0 inet6 alias -dad fd92:7065:b8e:ffff::$ns/64
+			;;
+		    hpux)
+			ifconfig lo0:$int 10.53.0.$ns netmask 255.255.255.0 up
+			ifconfig lo0:$int inet6 fd92:7065:b8e:ffff::$ns up
+		        ;;
+		    *-sco3.2v*)
+			ifconfig lo0 alias 10.53.0.$ns
+			;;
+		    *-darwin*)
+			ifconfig lo0 alias 10.53.0.$ns
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
+			;;
+	            *)
+			echo "Don't know how to set up interface.  Giving up."
+			exit 1
+		esac
+	done
+	;;
+
+    stop|down)
+	for ns in 7 6 5 4 3 2 1
+	do
+		if test -n "$base"
+		then
+			int=`expr $ns + $base - 1`
+		else
+			int=$ns
+		fi
+		case "$sys" in
+		    *-pc-solaris2.5.1)
+			ifconfig lo0:$int 0.0.0.0 down
+			;;
+		    *-sun-solaris2.[6-7])
+			ifconfig lo0:$int 10.53.0.$ns down
+			;;
+		    *-*-solaris2.[8-9]|*-*-solaris2.1[0-9])
+			ifconfig lo0:$int 10.53.0.$ns down
+			ifconfig lo0:$int 10.53.0.$ns unplumb
+			if test -n "$int6"
+			then
+				ifconfig lo0:$int6 inet6 down
+				ifconfig lo0:$int6 inet6 unplumb
+			fi
+			;;
+		    *-*-linux*)
+			ifconfig lo:$int 10.53.0.$ns down
+			ifconfig lo inet6 del fd92:7065:b8e:ffff::$ns/64
+		        ;;
+		    *-unknown-freebsd*)
+			ifconfig lo0 10.53.0.$ns delete
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
+			;;
+		    *-unknown-netbsd*)
+			ifconfig lo0 10.53.0.$ns delete
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
+			;;
+		    *-unknown-openbsd*)
+			ifconfig lo0 10.53.0.$ns delete
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
+			;;
+		    *-*-bsdi[3-5].*)
+			ifconfig lo0 remove 10.53.0.$ns
+			;;
+		    *-dec-osf[4-5].*)
+			ifconfig lo0 -alias 10.53.0.$ns
+			;;
+		    *-sgi-irix6.*)
+			ifconfig lo0 -alias 10.53.0.$ns
+			;;
+		    *-*-sysv5uw7*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+			ifconfig lo0 -alias 10.53.0.$ns
+			;;
+		    *-ibm-aix4.*|*-ibm-aix5.*)
+			ifconfig lo0 delete 10.53.0.$ns
+			ifconfig lo0 delete inet6 fd92:7065:b8e:ffff::$ns/64
+			;;
+		    hpux)
+			ifconfig lo0:$int 0.0.0.0
+			ifconfig lo0:$int inet6 ::
+		        ;;
+		    *-sco3.2v*)
+			ifconfig lo0 -alias 10.53.0.$ns
+			;;
+		    *darwin*)
+			ifconfig lo0 -alias 10.53.0.$ns
+			ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
+			;;
+	            *)
+			echo "Don't know how to destroy interface.  Giving up."
+			exit 1
+		esac
+	done
+
+	;;
+
+	*)
+		echo "Usage: $0 { up | down } [base]"
+		exit 1
+esac
diff --git a/tests/system/run.sh b/tests/system/run.sh
new file mode 100755
index 0000000..4f852f4
--- /dev/null
+++ b/tests/system/run.sh
@@ -0,0 +1,125 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007, 2010  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000, 2001  Internet Software Consortium.
+#
+# 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.
+
+#
+# Run a system test.
+#
+
+SYSTEMTESTTOP=.
+. $SYSTEMTESTTOP/conf.sh
+
+stopservers=true
+
+case $1 in
+   --keep) stopservers=false; shift ;;
+esac
+
+test $# -gt 0 || { echo "usage: $0 [--keep] test-directory" >&2; exit 1; }
+
+test=$1
+shift
+
+test -d $test || { echo "$0: $test: no such test" >&2; exit 1; }
+
+echo "S:$test:`date`" >&2
+echo "T:$test:1:A" >&2
+echo "A:System test $test" >&2
+
+if [ x$PERL = x ]
+then
+    echo "I:Perl not available.  Skipping test." >&2
+    echo "R:UNTESTED" >&2
+    echo "E:$test:`date`" >&2
+    exit 0;
+fi
+
+$PERL $TESTSOCK || {
+    echo "I:Network interface aliases not set up.  Skipping test." >&2;
+    echo "R:UNTESTED" >&2;
+    echo "E:$test:`date`" >&2;
+    exit 0;
+}
+
+
+# Check for test-specific prerequisites.
+test ! -f $test/prereq.sh || ( cd $test && sh prereq.sh "$@" )
+result=$?
+
+if [ $result -eq 0 ]; then
+    : prereqs ok
+else
+    echo "I:Prerequisites for $test missing, skipping test." >&2
+    [ $result -eq 255 ] && echo "R:SKIPPED" || echo "R:UNTESTED"
+    echo "E:$test:`date`" >&2
+    exit 0
+fi
+
+# Check for PKCS#11 support
+if
+    test ! -f $test/usepkcs11 || sh cleanpkcs11.sh
+then
+    : pkcs11 ok
+else
+    echo "I:Need PKCS#11 for $test, skipping test." >&2
+    echo "R:PKCS11ONLY" >&2
+    echo "E:$test:`date`" >&2
+    exit 0
+fi
+
+# Set up any dynamically generated test data
+if test -f $test/setup.sh
+then
+   ( cd $test && sh setup.sh "$@" )
+fi
+
+# Start name servers running
+$PERL start.pl $test || exit 1
+
+# Run the tests
+( cd $test ; sh tests.sh )
+
+status=$?
+
+if $stopservers
+then
+    :
+else
+    exit $status
+fi
+
+# Shutdown
+$PERL stop.pl $test
+
+status=`expr $status + $?`
+
+if [ $status != 0 ]; then
+	echo "R:FAIL"
+	# Don't clean up - we need the evidence.
+	find . -name core -exec chmod 0644 '{}' \;
+else
+	echo "R:PASS"
+
+	# Clean up.
+	if test -f $test/clean.sh
+	then
+	   ( cd $test && sh clean.sh "$@" )
+	fi
+fi
+
+echo "E:$test:`date`"
+
+exit $status
diff --git a/tests/system/runall.sh b/tests/system/runall.sh
new file mode 100755
index 0000000..5d0fe9b
--- /dev/null
+++ b/tests/system/runall.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (C) 2004, 2007, 2010  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2000, 2001  Internet Software Consortium.
+#
+# 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.
+
+#
+# Run all the system tests.
+#
+
+SYSTEMTESTTOP=.
+. $SYSTEMTESTTOP/conf.sh
+
+status=0
+
+for d in $SUBDIRS
+do
+	sh run.sh $d || status=1
+done
+
+$PERL $TESTSOCK || {
+    cat <<EOF >&2
+I:
+I:NOTE: Many of the tests were skipped because they require that
+I:      the IP addresses 10.53.0.1 through 10.53.0.7 are configured
+I:	as alias addresses on the loopback interface.  Please run
+I:	"tests/system/ifconfig.sh up" as root to configure them
+I:	and rerun the tests.
+EOF
+    exit 0;
+}
+
+exit $status
diff --git a/tests/system/start.pl b/tests/system/start.pl
new file mode 100755
index 0000000..56f00c4
--- /dev/null
+++ b/tests/system/start.pl
@@ -0,0 +1,226 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2004-2008, 2010  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2001  Internet Software Consortium.
+#
+# 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.
+
+# Framework for starting test servers.
+# Based on the type of server specified, check for port availability, remove
+# temporary files, start the server, and verify that the server is running.
+# If a server is specified, start it. Otherwise, start all servers for test.
+
+use strict;
+use Cwd 'abs_path';
+use Getopt::Long;
+
+# Option handling
+#   --noclean test [server [options]]
+#
+#   --noclean - Do not cleanup files in server directory
+#   test - name of the test directory
+#   server - name of the server directory
+#   options - alternate options for the server
+
+my $usage = "usage: $0 [--noclean] test-directory [server-directory [server-options]]";
+my $noclean;
+GetOptions('noclean' => \$noclean);
+my $test = $ARGV[0];
+my $server = $ARGV[1];
+my $options = $ARGV[2];
+
+if (!$test) {
+	print "$usage\n";
+}
+if (!-d $test) {
+	print "No test directory: \"$test\"\n";
+}
+if ($server && !-d "$test/$server") {
+	print "No server directory: \"$test/$server\"\n";
+}
+
+# Global variables
+my $topdir = abs_path("$test/..");
+my $testdir = abs_path("$test");
+my $RUN_BIND10 = $ENV{'RUN_BIND10'};
+my $NAMED = $ENV{'NAMED'};
+my $LWRESD = $ENV{'LWRESD'};
+my $DIG = $ENV{'DIG'};
+my $PERL = $ENV{'PERL'};
+my $TESTSOCK = $ENV{'TESTSOCK'};
+
+# Start the server(s)
+
+if ($server) {
+	if ($server =~ /^ns/) {
+		&check_ports($server);
+	}
+	&start_server($server, $options);
+	if ($server =~ /^ns/) {
+		&verify_server($server);
+	}
+} else {
+	# Determine which servers need to be started for this test.
+	opendir DIR, $testdir;
+	my @files = sort readdir DIR;
+	closedir DIR;
+
+	my @ns = grep /^nsx?[0-9]*$/, @files;
+	my @lwresd = grep /^lwresd[0-9]*$/, @files;
+	my @ans = grep /^ans[0-9]*$/, @files;
+
+	# Start the servers we found.
+	&check_ports();
+	foreach my $s (@ns, @lwresd, @ans) {
+		&start_server($s);
+	}
+	foreach my $s (@ns) {
+		&verify_server($s);
+	}
+}
+
+# Subroutines
+
+sub check_ports {
+	my $server = shift;
+	my $options = "";
+
+	if ($server && $server =~ /(\d+)$/) {
+		$options = "-i $1";
+	}
+
+	my $tries = 0;
+	while (1) {
+		my $return = system("$PERL $TESTSOCK -p 53210 $options");
+		last if ($return == 0);
+		if (++$tries > 4) {
+			print "$0: could not bind to server addresses, still running?\n";
+			print "I:server sockets not available\n";
+			print "R:FAIL\n";
+			system("$PERL $topdir/stop.pl $testdir"); # Is this the correct behavior?
+			exit 1;
+		}
+		print "I:Couldn't bind to socket (yet)\n";
+		sleep 2;
+	}
+}
+
+sub start_server {
+	my $server = shift;
+	my $options = shift;
+
+	my $cleanup_files;
+	my $command;
+	my $pid_file;
+
+	if ($server =~ /^nsx/) {
+		$cleanup_files = "{bind10.run}";
+		$command = "B10_FROM_SOURCE_LOCALSTATEDIR=$testdir/$server/ ";
+		$command .= "$RUN_BIND10 ";
+		if ($options) {
+			$command .= "$options";
+		} else {
+			$command .= "--msgq-socket-file=$testdir/$server/msgq_socket ";
+			$command .= "--pid-file=$testdir/$server/bind10.pid ";
+			$command .= "-v";
+		}
+		$command .= " >bind10.run 2>&1 &";
+		$pid_file = "bind10.pid";
+	} elsif ($server =~ /^ns/) {
+		$cleanup_files = "{*.jnl,*.bk,*.st,named.run}";
+		$command = "$NAMED ";
+		if ($options) {
+			$command .= "$options";
+		} else {
+			$command .= "-m record,size,mctx ";
+			$command .= "-T clienttest ";
+			$command .= "-T nosoa "
+				if (-e "$testdir/$server/named.nosoa");
+			$command .= "-T noaa "
+				if (-e "$testdir/$server/named.noaa");
+			$command .= "-c named.conf -d 99 -g";
+		}
+		$command .= " >named.run 2>&1 &";
+		$pid_file = "named.pid";
+	} elsif ($server =~ /^lwresd/) {
+		$cleanup_files = "{lwresd.run}";
+		$command = "$LWRESD ";
+		if ($options) {
+			$command .= "$options";
+		} else {
+			$command .= "-m record,size,mctx ";
+			$command .= "-T clienttest ";
+			$command .= "-C resolv.conf -d 99 -g ";
+			$command .= "-i lwresd.pid -P 9210 -p 53210";
+		}
+		$command .= " >lwresd.run 2>&1 &";
+		$pid_file = "lwresd.pid";
+	} elsif ($server =~ /^ans/) {
+		$cleanup_files = "{ans.run}";
+		$command = "$PERL ./ans.pl ";
+		if ($options) {
+			$command .= "$options";
+		} else {
+			$command .= "";
+		}
+		$command .= " >ans.run 2>&1 &";
+		$pid_file = "ans.pid";
+	} else {
+		print "I:Unknown server type $server\n";
+		print "R:FAIL\n";
+		system "$PERL $topdir/stop.pl $testdir";
+		exit 1;
+	}
+
+	#               print "I:starting server $server\n";
+
+	chdir "$testdir/$server";
+
+	unless ($noclean) {
+		unlink glob $cleanup_files;
+	}
+
+	system "$command";
+
+	my $tries = 0;
+	while (!-f $pid_file) {
+		if (++$tries > 14) {
+			print "I:Couldn't start server $server\n";
+			print "R:FAIL\n";
+			system "$PERL $topdir/stop.pl $testdir";
+			exit 1;
+		}
+		sleep 1;
+	}
+}
+
+sub verify_server {
+	my $server = shift;
+	my $n = $server;
+	$n =~ s/^nsx?//;
+
+	my $tries = 0;
+	while (1) {
+		my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd -p 53210 version.bind. chaos txt \@10.53.0.$n > dig.out");
+		last if ($return == 0);
+		print `grep ";" dig.out`;
+		if (++$tries >= 30) {
+			print "I:no response from $server\n";
+			print "R:FAIL\n";
+			system("$PERL $topdir/stop.pl $testdir");
+			exit 1;
+		}
+		sleep 2;
+	}
+	unlink "dig.out";
+}
diff --git a/tests/system/stop.pl b/tests/system/stop.pl
new file mode 100755
index 0000000..a803f52
--- /dev/null
+++ b/tests/system/stop.pl
@@ -0,0 +1,188 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2001  Internet Software Consortium.
+#
+# 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.
+
+# Framework for stopping test servers
+# Based on the type of server specified, signal the server to stop, wait
+# briefly for it to die, and then kill it if it is still alive.
+# If a server is specified, stop it. Otherwise, stop all servers for test.
+
+use strict;
+use Cwd 'abs_path';
+
+# Option handling
+#   [--use-rndc] test [server]
+#
+#   test - name of the test directory
+#   server - name of the server directory
+
+my $usage = "usage: $0 [--use-rndc] test-directory [server-directory]";
+my $use_rndc;
+
+while (@ARGV && $ARGV[0] =~ /^-/) {
+	my $opt = shift @ARGV;
+	if ($opt eq '--use-rndc') {
+		$use_rndc = 1;
+	} else {
+		die "$usage\n";
+	}
+}
+
+my $test = $ARGV[0];
+my $server = $ARGV[1];
+
+my $errors = 0;
+
+die "$usage\n" unless defined($test);
+die "No test directory: \"$test\"\n" unless (-d $test);
+die "No server directory: \"$server\"\n" if (defined($server) && !-d "$test/$server");
+
+# Global variables
+my $testdir = abs_path($test);
+my @servers;
+
+
+# Determine which servers need to be stopped.
+if (defined $server) {
+	@servers = ($server);
+} else {
+	local *DIR;
+	opendir DIR, $testdir or die "$testdir: $!\n";
+	my @files = sort readdir DIR;
+	closedir DIR;
+
+	my @ns = grep /^nsx?[0-9]*$/, @files;
+	my @lwresd = grep /^lwresd[0-9]*$/, @files;
+	my @ans = grep /^ans[0-9]*$/, @files;
+
+	push @servers, @ns, @lwresd, @ans;
+}
+
+
+# Stop the server(s), pass 1: rndc.
+if ($use_rndc) {
+	foreach my $server (grep /^ns/, @servers) {
+		stop_rndc($server);
+	}
+
+	wait_for_servers(30, grep /^ns/, @servers);
+}
+
+
+# Pass 2: SIGTERM
+foreach my $server (@servers) {
+	stop_signal($server, "TERM");
+}
+
+wait_for_servers(60, @servers);
+
+# Pass 3: SIGABRT
+foreach my $server (@servers) {
+	stop_signal($server, "ABRT");
+}
+
+exit($errors ? 1 : 0);
+
+# Subroutines
+
+# Return the full path to a given server's PID file.
+sub server_pid_file {
+	my($server) = @_;
+
+	my $pid_file;
+	if ($server =~ /^nsx/) {
+		$pid_file = "bind10.pid";
+	} elsif ($server =~ /^ns/) {
+		$pid_file = "named.pid";
+	} elsif ($server =~ /^lwresd/) {
+		$pid_file = "lwresd.pid";
+	} elsif ($server =~ /^ans/) {
+		$pid_file = "ans.pid";
+	} else {
+		print "I:Unknown server type $server\n";
+		exit 1;
+	}
+	$pid_file = "$testdir/$server/$pid_file";
+}
+
+# Read a PID.
+sub read_pid {
+	my($pid_file) = @_;
+
+	local *FH;
+	my $result = open FH, "< $pid_file";
+	if (!$result) {
+		print "I:$pid_file: $!\n";
+		unlink $pid_file;
+		return;
+	}
+
+	my $pid = <FH>;
+	chomp($pid);
+	return $pid;
+}
+
+# Stop a named process with rndc.
+sub stop_rndc {
+	my($server) = @_;
+
+	return unless ($server =~ /^ns(\d+)$/);
+	my $ip = "10.53.0.$1";
+
+	# Ugly, but should work.
+	system("$ENV{RNDC} -c $testdir/../common/rndc.conf -s $ip -p 9953 stop | sed 's/^/I:$server /'");
+	return;
+}
+
+# Stop a server by sending a signal to it.
+sub stop_signal {
+	my($server, $sig) = @_;
+
+	my $pid_file = server_pid_file($server);
+	return unless -f $pid_file;
+
+	my $pid = read_pid($pid_file);
+	return unless defined($pid);
+
+	if ($sig eq 'ABRT') {
+		print "I:$server didn't die when sent a SIGTERM\n";
+		$errors++;
+	}
+
+	my $result = kill $sig, $pid;
+	if (!$result) {
+		print "I:$server died before a SIG$sig was sent\n";
+		unlink $pid_file;
+		$errors++;
+	}
+
+	return;
+}
+
+sub wait_for_servers {
+	my($timeout, @servers) = @_;
+
+	my @pid_files = grep { defined($_) }
+	                map  { server_pid_file($_) } @servers;
+
+	while ($timeout > 0 && @pid_files > 0) {
+		@pid_files = grep { -f $_ } @pid_files;
+		sleep 1 if (@pid_files > 0);
+		$timeout--;
+	}
+
+	return;
+}




More information about the bind10-changes mailing list