xfrin_bind10.feature 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Feature: Xfrin
  2. Tests for Xfrin, specific for BIND 10 behaviour.
  3. Scenario: Retransfer command
  4. # Standard check to test (non-)existence of a file.
  5. # This file is actually automatically created.
  6. The file data/test_nonexistent_db.sqlite3 should not exist
  7. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  8. And wait for master stderr message BIND10_STARTED_CC
  9. And wait for master stderr message CMDCTL_STARTED
  10. And wait for master stderr message AUTH_SERVER_STARTED
  11. And wait for master stderr message XFROUT_STARTED
  12. And wait for master stderr message ZONEMGR_STARTED
  13. And I have bind10 running with configuration xfrin/retransfer_slave.conf
  14. And wait for bind10 stderr message BIND10_STARTED_CC
  15. And wait for bind10 stderr message CMDCTL_STARTED
  16. And wait for bind10 stderr message AUTH_SERVER_STARTED
  17. And wait for bind10 stderr message XFRIN_STARTED
  18. And wait for bind10 stderr message ZONEMGR_STARTED
  19. # Now we use the first step again to see if the file has been created
  20. The file data/test_nonexistent_db.sqlite3 should exist
  21. A query for www.example.org to [::1]:47806 should have rcode REFUSED
  22. When I send bind10 the command Xfrin retransfer example.org IN ::1 47807
  23. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  24. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  25. A query for www.example.org to [::1]:47806 should have rcode NOERROR
  26. # The transferred zone should have 11 non-NSEC3 RRs and 1 NSEC3 RR.
  27. # The following check will get these by AXFR, so the total # of RRs
  28. # should be 13, counting the duplicated SOA.
  29. # At this point we can confirm both in and out of AXFR for a zone
  30. # containing an NSEC3 RR.
  31. # We don't have to specify the address/port here; the defaults will work.
  32. When I do an AXFR transfer of example.org
  33. Then transfer result should have 13 rrs
  34. Scenario: Transfer with TSIG
  35. # Similar setup to the test above, but this time, we add TSIG configuration
  36. # In order to check that the tests don't give false positives because config
  37. # happens to be right (like no TSIG on either side), we take an existing
  38. # non-TSIG config, add TSIG on the master side, see it fail, add TSIG
  39. # on the slave side, then check again.
  40. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  41. And wait for master stderr message AUTH_SERVER_STARTED
  42. And wait for master stderr message XFROUT_STARTED
  43. And I have bind10 running with configuration xfrin/retransfer_slave.conf
  44. And wait for bind10 stderr message CMDCTL_STARTED
  45. And wait for bind10 stderr message XFRIN_STARTED
  46. # Set slave config for 'automatic' xfrin
  47. When I set bind10 configuration Xfrin/zones to [{"master_port": 47806, "name": "example.org", "master_addr": "::1"}]
  48. # Make sure it is fully open
  49. When I send bind10 the command Xfrin retransfer example.org
  50. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  51. And wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  52. # First to master, a transfer should then fail
  53. When I send bind10 the following commands with cmdctl port 47804:
  54. """
  55. config add tsig_keys/keys "example.key.:c2VjcmV0"
  56. config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "::1", "key": "example.key."}]
  57. config commit
  58. """
  59. # Transfer should fail
  60. When I send bind10 the command Xfrin retransfer example.org
  61. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_ERROR not XFRIN_TRANSFER_SUCCESS
  62. # Set client to use TSIG as well
  63. When I send bind10 the following commands:
  64. """
  65. config add tsig_keys/keys "example.key.:c2VjcmV0"
  66. config set Xfrin/zones[0]/tsig_key "example.key.:c2VjcmV0"
  67. config commit
  68. """
  69. # Transwer should succeed now
  70. When I send bind10 the command Xfrin retransfer example.org
  71. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE