bindctl_commands.feature 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. # the bad command should also keep existing changes intact,
  88. # i.e. if we add something, then run a failing script, our
  89. # addition should still be there, but those from the script
  90. # should not
  91. When I send bind10 the following commands:
  92. """
  93. config add Boss/components b10-resolver
  94. config set Boss/components/b10-resolver/kind dispensable
  95. config set Boss/components/b10-resolver/special resolver
  96. execute file data/commands/bad_command
  97. config commit
  98. """
  99. last bindctl output should contain shouldshow
  100. last bindctl output should contain Error
  101. last bindctl output should not contain shouldnotshow
  102. # This would fail if the entire list was passed, or the configuratio
  103. send bind10 the command config show Boss/components
  104. last bindctl output should not contain b10-auth
  105. last bindctl output should contain b10-resolver
  106. # nested_command contains another execute script
  107. When I send bind10 the command execute file data/commands/nested
  108. last bindctl output should contain shouldshow
  109. last bindctl output should not contain Error
  110. # show commands from a file
  111. When I send bind10 the command execute file data/commands/bad_command show
  112. last bindctl output should not contain Error
  113. last bindctl output should contain shouldshow
  114. last bindctl output should contain shouldnotshow
  115. Scenario: Executing builting script init_authoritative_server
  116. Given I have bind10 running with configuration bindctl/bindctl.config
  117. And wait for bind10 stderr message BIND10_STARTED_CC
  118. And wait for bind10 stderr message CMDCTL_STARTED
  119. When I send bind10 the command execute init_authoritative_server show
  120. # just test some parts of the output
  121. last bindctl output should contain /Boss/components/b10-auth/special
  122. last bindctl output should contain /Boss/components/b10-zonemgr/kind
  123. last bindctl output should contain Please
  124. # nothing should have been changed
  125. When I send bind10 the command config diff
  126. last bindctl output should contain {}
  127. # ok now make sure modules aren't running, execute it, and make
  128. # sure modules are running
  129. bind10 module Auth should not be running
  130. bind10 module Xfrout should not be running
  131. bind10 module Xfrin should not be running
  132. bind10 module Zonemgr should not be running
  133. When I send bind10 the following commands:
  134. """
  135. execute init_authoritative_server
  136. config commit
  137. """
  138. And wait for bind10 stderr message AUTH_SERVER_STARTED
  139. And wait for bind10 stderr message ZONEMGR_STARTED
  140. And wait for bind10 stderr message XFRIN_STARTED
  141. And wait for bind10 stderr message XFROUT_STARTED
  142. last bindctl output should not contain Error
  143. bind10 module Auth should be running
  144. bind10 module Xfrout should be running
  145. bind10 module Xfrin should be running
  146. bind10 module Zonemgr should be running