bindctl_commands.feature 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 echoexample2
  77. last bindctl output should contain verbosecommentexample3
  78. last bindctl output should not contain commentexample4
  79. last bindctl output should contain echoexample5
  80. last bindctl output should contain echoexample6
  81. last bindctl output should contain verbosecommentexample7
  82. last bindctl output should not contain commentexample8
  83. # bad_command contains a bad command, at which point execution should stop
  84. When I send bind10 the command execute file data/commands/bad_command
  85. last bindctl output should contain shouldshow
  86. last bindctl output should contain Error
  87. last bindctl output should not contain shouldnotshow
  88. # This would fail if the entire list was passed, or the configuration
  89. # was committed
  90. send bind10 the command config show Boss/components
  91. last bindctl output should not contain b10-auth
  92. # nested_command contains another execute script
  93. When I send bind10 the command execute file data/commands/nested
  94. last bindctl output should contain shouldshow
  95. last bindctl output should not contain Error
  96. # show commands from a file
  97. When I send bind10 the command execute file data/commands/bad_command show
  98. last bindctl output should not contain Error
  99. last bindctl output should contain shouldshow
  100. last bindctl output should contain shouldnotshow
  101. Scenario: Executing builting script init_authoritative_server
  102. Given I have bind10 running with configuration bindctl/bindctl.config
  103. And wait for bind10 stderr message BIND10_STARTED_CC
  104. And wait for bind10 stderr message CMDCTL_STARTED
  105. When I send bind10 the command execute init_authoritative_server show
  106. # just test some parts of the output
  107. last bindctl output should contain /Boss/components/b10-auth/special
  108. last bindctl output should contain /Boss/components/b10-zonemgr/kind
  109. last bindctl output should contain Please
  110. # nothing should have been changed
  111. When I send bind10 the command config diff
  112. last bindctl output should contain {}
  113. # ok now make sure modules aren't running, execute it, and make
  114. # sure modules are running
  115. bind10 module Auth should not be running
  116. bind10 module Xfrout should not be running
  117. bind10 module Xfrin should not be running
  118. bind10 module Zonemgr should not be running
  119. When I send bind10 the following commands:
  120. """
  121. execute init_authoritative_server
  122. config commit
  123. """
  124. And wait for bind10 stderr message AUTH_SERVER_STARTED
  125. And wait for bind10 stderr message ZONEMGR_STARTED
  126. And wait for bind10 stderr message XFRIN_STARTED
  127. And wait for bind10 stderr message XFROUT_STARTED
  128. last bindctl output should not contain Error
  129. bind10 module Auth should be running
  130. bind10 module Xfrout should be running
  131. bind10 module Xfrin should be running
  132. bind10 module Zonemgr should be running