bindctl_commands.feature 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. Feature: control with bindctl
  2. Assorted tests using bindctl for the administration of BIND 10.
  3. Scenario: Removing modules
  4. # This test runs the original example configuration, which has
  5. # a number of modules. It then removes all non-essential modules,
  6. # and checks whether they do disappear from the list of running
  7. # modules (note that it 'misuses' the help command for this,
  8. # there is a Boss command 'show_processes' but it's output is
  9. # currently less standardized than 'help')
  10. Given I have bind10 running with configuration bindctl_commands.config
  11. And wait for bind10 stderr message BIND10_STARTED_CC
  12. And wait for bind10 stderr message CMDCTL_STARTED
  13. And wait for bind10 stderr message ZONEMGR_STARTED
  14. And wait for bind10 stderr message AUTH_SERVER_STARTED
  15. And wait for bind10 stderr message XFRIN_STARTED
  16. And wait for bind10 stderr message XFROUT_STARTED
  17. And wait for bind10 stderr message STATS_STARTING
  18. And wait for bind10 stderr message STATHTTPD_STARTED
  19. Then remove bind10 configuration Boss/components/NOSUCHMODULE
  20. last bindctl output should contain Error
  21. bind10 module Xfrout should be running
  22. bind10 module Stats should be running
  23. bind10 module Zonemgr should be running
  24. bind10 module Xfrin should be running
  25. bind10 module Auth should be running
  26. bind10 module StatsHttpd should be running
  27. bind10 module Resolver should not be running
  28. Then remove bind10 configuration Boss/components value b10-xfrout
  29. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  30. last bindctl output should not contain Error
  31. # assuming it won't error for further modules (if it does, the final
  32. # 'should not be running' tests would fail anyway)
  33. Then remove bind10 configuration Boss/components value b10-stats-httpd
  34. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  35. last bindctl output should not contain Error
  36. Then remove bind10 configuration Boss/components value b10-stats
  37. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  38. last bindctl output should not contain Error
  39. Then remove bind10 configuration Boss/components value b10-zonemgr
  40. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  41. last bindctl output should not contain Error
  42. Then remove bind10 configuration Boss/components value b10-xfrin
  43. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  44. last bindctl output should not contain Error
  45. Then remove bind10 configuration Boss/components value b10-auth
  46. And wait for new bind10 stderr message BIND10_PROCESS_ENDED
  47. last bindctl output should not contain Error
  48. # After these ^^^ have been stopped...
  49. bind10 module Xfrout should not be running
  50. bind10 module Zonemgr should not be running
  51. bind10 module Xfrin should not be running
  52. bind10 module Auth should not be running
  53. bind10 module StatsHttpd should not be running
  54. bind10 module Stats should not be running
  55. bind10 module Resolver should not be running
  56. Scenario: Executing scripts from files
  57. # This test tests the 'execute' command, which reads and executes
  58. # bindctl commands from a file
  59. Given I have bind10 running with configuration bindctl/bindctl.config
  60. And wait for bind10 stderr message BIND10_STARTED_CC
  61. And wait for bind10 stderr message CMDCTL_STARTED
  62. # first a few bad commands
  63. When I send bind10 the command execute
  64. last bindctl output should contain Error
  65. When I send bind10 the command execute file
  66. last bindctl output should contain Error
  67. When I send bind10 the command execute file data/commands/nosuchfile
  68. last bindctl output should contain Error
  69. # empty list should be no-op
  70. When I send bind10 the command execute file data/commands/empty
  71. last bindctl output should not contain Error
  72. # some tests of directives like !echo and !verbose
  73. When I send bind10 the command execute file data/commands/directives
  74. last bindctl output should not contain Error
  75. last bindctl output should not contain commentexample1
  76. last bindctl output should contain echoexample
  77. last bindctl output should contain verbosecommentexample
  78. last bindctl output should not contain commentexample2
  79. # bad_command contains a bad command, at which point execution should stop
  80. When I send bind10 the command execute file data/commands/bad_command
  81. last bindctl output should contain shouldshow
  82. last bindctl output should contain Error
  83. last bindctl output should not contain shouldnotshow
  84. # This would fail if the entire list was passed, or the configuratio
  85. send bind10 the command config show Boss/components
  86. last bindctl output should not contain b10-auth
  87. # nested_command contains another execute script
  88. When I send bind10 the command execute file data/commands/nested
  89. last bindctl output should contain shouldshow
  90. last bindctl output should not contain Error
  91. # show commands from a file
  92. When I send bind10 the command execute file data/commands/bad_command show
  93. last bindctl output should not contain Error
  94. last bindctl output should contain shouldshow
  95. last bindctl output should contain shouldnotshow
  96. Scenario: Executing builting script init_authoritative_server
  97. Given I have bind10 running with configuration bindctl/bindctl.config
  98. And wait for bind10 stderr message BIND10_STARTED_CC
  99. And wait for bind10 stderr message CMDCTL_STARTED
  100. When I send bind10 the command execute init_authoritative_server show
  101. # just test some parts of the output
  102. last bindctl output should contain /Boss/components/b10-auth/special
  103. last bindctl output should contain /Boss/components/b10-zonemgr/kind
  104. last bindctl output should contain Please
  105. # nothing should have been changed
  106. When I send bind10 the command config diff
  107. last bindctl output should contain {}
  108. # ok now make sure modules aren't running, execute it, and make
  109. # sure modules are running
  110. bind10 module Auth should not be running
  111. bind10 module Xfrout should not be running
  112. bind10 module Xfrin should not be running
  113. bind10 module Zonemgr should not be running
  114. When I send bind10 the following commands:
  115. """
  116. execute init_authoritative_server
  117. config commit
  118. """
  119. And wait for bind10 stderr message AUTH_SERVER_STARTED
  120. And wait for bind10 stderr message ZONEMGR_STARTED
  121. And wait for bind10 stderr message XFRIN_STARTED
  122. And wait for bind10 stderr message XFROUT_STARTED
  123. last bindctl output should not contain Error
  124. bind10 module Auth should be running
  125. bind10 module Xfrout should be running
  126. bind10 module Xfrin should be running
  127. bind10 module Zonemgr should be running