From: Jelte Jansen Date: Wed, 13 Jun 2012 09:16:28 +0000 (+0200) Subject: [1461] add commented-out ddns-xfrout test X-Git-Tag: trac2351_base~226^2~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca65e4d61722b212b7ad05ec44ecda7cdc4d105d;p=thirdparty%2Fkea.git [1461] add commented-out ddns-xfrout test +support for it --- diff --git a/tests/lettuce/data/example.org.sqlite3 b/tests/lettuce/data/example.org.sqlite3 index b6a9c4b0c2..f79a4e27f1 100644 Binary files a/tests/lettuce/data/example.org.sqlite3 and b/tests/lettuce/data/example.org.sqlite3 differ diff --git a/tests/lettuce/features/ddns_system.feature b/tests/lettuce/features/ddns_system.feature index a7f58559d9..9585f7a375 100644 --- a/tests/lettuce/features/ddns_system.feature +++ b/tests/lettuce/features/ddns_system.feature @@ -80,7 +80,6 @@ Feature: DDNS System And the SOA serial for example.org should be 1239 Scenario: ACL - # The given config has b10-ddns disabled Given I have bind10 running with configuration ddns/ddns.config And wait for bind10 stderr message BIND10_STARTED_CC And wait for bind10 stderr message AUTH_SERVER_STARTED @@ -111,3 +110,27 @@ Feature: DDNS System The DDNS response should be SUCCESS A query for new3.example.org should have rcode NOERROR The SOA serial for example.org should be 1236 + + #Scenario: DDNS and Xfrout + ## Unfortunately, Xfrout can only notify to inzone slaves, and hence only + ## to port 53, which we do not want to use for Lettuce tests (for various + ## reasons). So for now this test is only an outline, the configs + ## themselves have not been set up yet + # When I start bind10 with configuration ddns/primary.config as primary + # And wait for primary stderr message AUTH_SERVER_STARTED + # And wait for primary stderr message XFROUT_STARTED + # And wait for primary stderr message DDNS_RUNNING + + # And I start bind10 with configuration example2.org.config with cmdctl port 47804 as secondary + # And wait for secondary stderr message AUTH_SERVER_STARTED + # And wait for secondary stderr message XFRIN_STARTED + + # # Sanity check + # The SOA serial for example.org should be 1234 + # The SOA serial for example.org at 127.0.0.1:47807 should be 1234 + + # When I use DDNS to set the SOA serial to 1235 + # The DDNS response should be SUCCESS + + # The SOA serial for example.org should be 1235 + # The SOA serial for example.org at 127.0.0.1:47807 should be 1235 diff --git a/tests/lettuce/features/example.feature b/tests/lettuce/features/example.feature index 9b7c2ca27f..cac5d69b38 100644 --- a/tests/lettuce/features/example.feature +++ b/tests/lettuce/features/example.feature @@ -182,9 +182,13 @@ Feature: Example feature A query for www.example.org to 127.0.0.1:47806 should have rcode NOERROR A query for www.example.org to [::1]:47807 should have rcode NOERROR + The SOA serial for example.org should be 1234 + The SOA serial for example.org at 127.0.0.1:47806 should be 1234 + The SOA serial for example.org at ::1:47807 should be 1234 Then set bind10 configuration Auth/database_file to data/empty_db.sqlite3 And wait for bind10_one stderr message DATASRC_SQLITE_OPEN A query for www.example.org to 127.0.0.1:47806 should have rcode REFUSED A query for www.example.org to [::1]:47807 should have rcode NOERROR + diff --git a/tests/lettuce/features/terrain/querying.py b/tests/lettuce/features/terrain/querying.py index a5470147aa..abd7c18059 100644 --- a/tests/lettuce/features/terrain/querying.py +++ b/tests/lettuce/features/terrain/querying.py @@ -240,8 +240,8 @@ def query(step, dnssec, query_name, qtype, qclass, addr, port, rcode): "Expected: " + rcode + ", got " + query_result.rcode world.last_query_result = query_result -@step('The SOA serial for ([\w.]+) should be ([0-9]+)') -def query_soa(step, query_name, serial): +@step('The SOA serial for ([\S.]+) (?:at (\S+)(?::([0-9]+)) )?should be ([0-9]+)') +def query_soa(step, query_name, address, port, serial=None): """ Convenience function to check the SOA SERIAL value of the given zone at the nameserver at the default address (127.0.0.1:47806). @@ -251,7 +251,11 @@ def query_soa(step, query_name, serial): If the rcode is not NOERROR, or the answer section does not contain the SOA record, this step fails. """ - query_result = QueryResult(query_name, "SOA", "IN", "127.0.0.1", "47806") + if address is None: + address = "127.0.0.1" + if port is None: + port = "47806" + query_result = QueryResult(query_name, "SOA", "IN", address, port) assert "NOERROR" == query_result.rcode,\ "Got " + query_result.rcode + ", expected NOERROR" assert len(query_result.answer_section) == 1,\