From: Jelte Jansen Date: Thu, 8 Nov 2012 16:25:48 +0000 (+0100) Subject: [2464] Add lettuce test for TSIG X-Git-Tag: trac2487_base~1^2~23^2~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80bc337e580fda1f03a003e87c4a9d5e7576d885;p=thirdparty%2Fkea.git [2464] Add lettuce test for TSIG Should fail at this time --- diff --git a/tests/lettuce/configurations/xfrin/retransfer_slave.conf b/tests/lettuce/configurations/xfrin/retransfer_slave.conf.orig similarity index 100% rename from tests/lettuce/configurations/xfrin/retransfer_slave.conf rename to tests/lettuce/configurations/xfrin/retransfer_slave.conf.orig diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py index 2bfe7d4f14..74cdfeaba8 100644 --- a/tests/lettuce/features/terrain/terrain.py +++ b/tests/lettuce/features/terrain/terrain.py @@ -61,6 +61,8 @@ copylist = [ "configurations/ddns/noddns.config"], ["configurations/xfrin/retransfer_master.conf.orig", "configurations/xfrin/retransfer_master.conf"], + ["configurations/xfrin/retransfer_slave.conf.orig", + "configurations/xfrin/retransfer_slave.conf"], ["data/inmem-xfrin.sqlite3.orig", "data/inmem-xfrin.sqlite3"], ["data/xfrin-notify.sqlite3.orig", diff --git a/tests/lettuce/features/xfrin_bind10.feature b/tests/lettuce/features/xfrin_bind10.feature index 7a45ddd8b5..3c7fa1c186 100644 --- a/tests/lettuce/features/xfrin_bind10.feature +++ b/tests/lettuce/features/xfrin_bind10.feature @@ -1,6 +1,6 @@ -Feature: Xfrin +Feature: Xfrin Tests for Xfrin, specific for BIND 10 behaviour. - + Scenario: Retransfer command # Standard check to test (non-)existence of a file. # This file is actually automatically created. @@ -37,3 +37,52 @@ Feature: Xfrin # We don't have to specify the address/port here; the defaults will work. When I do an AXFR transfer of example.org Then transfer result should have 13 rrs + + + + Scenario: Transfer with TSIG + # Similar setup to the test above, but this time, we add TSIG configuration + + # In order to check that the tests don't give false positives because config + # happens to be right (like no TSIG on either side), we take an existing + # non-TSIG config, add TSIG on the master side, see it fail, add TSIG + # on the slave side, then check again. + + Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master + And wait for master stderr message AUTH_SERVER_STARTED + And wait for master stderr message XFROUT_STARTED + + And I have bind10 running with configuration xfrin/retransfer_slave.conf + And wait for bind10 stderr message CMDCTL_STARTED + And wait for bind10 stderr message XFRIN_STARTED + + # Set slave config for 'automatic' xfrin + When I set bind10 configuration Xfrin/zones to [{"master_port": 47806, "name": "example.org", "master_addr": "::1"}] + + # Make sure it is fully open + When I send bind10 the command Xfrin retransfer example.org + Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE + And wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS + + # First to master, a transfer should then fail + When I send bind10 the following commands with cmdctl port 47804: + """ + config add tsig_keys/keys "example.key.:c2VjcmV0" + config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "::1", "key": "example.key."}] + config commit + """ + + # Transfer should fail + When I send bind10 the command Xfrin retransfer example.org + Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_ERROR not XFRIN_TRANSFER_SUCCESS + # Set client to use TSIG as well + When I send bind10 the following commands: + """ + config add tsig_keys/keys "example.key.:c2VjcmV0" + config set Xfrin/zones[0]/tsig_key "example.key.:c2VjcmV0" + config commit + """ + + # Transwer should succeed now + When I send bind10 the command Xfrin retransfer example.org + Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE