bindctl_commands.feature 4.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
Feature: control with bindctl
    Assorted tests using bindctl for the administration of BIND 10.

    Scenario: Removing modules
    # This test runs the original example configuration, which has
    # a number of modules. It then removes all non-essential modules,
    # and checks whether they do disappear from the list of running
    # modules (note that it 'misuses' the help command for this,
    # there is a Boss command 'show_processes' but it's output is
    # currently less standardized than 'help')
11
12
13
    Given I have bind10 running with configuration bindctl_commands.config
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
14
15
16
17
18
19
20
    And wait for bind10 stderr message ZONEMGR_STARTED
    And wait for bind10 stderr message AUTH_SERVER_STARTED
    And wait for bind10 stderr message XFRIN_STARTED
    And wait for bind10 stderr message XFROUT_STARTED
    And wait for bind10 stderr message STATS_STARTING
    And wait for bind10 stderr message STATHTTPD_STARTED

21
22
23
24
25
26
27
28
29
    Then remove bind10 configuration Boss/components/NOSUCHMODULE
    last bindctl output should contain Error

    bind10 module Xfrout should be running
    bind10 module Stats should be running
    bind10 module Zonemgr should be running
    bind10 module Xfrin should be running
    bind10 module Auth should be running
    bind10 module StatsHttpd should be running
30
    bind10 module Resolver should not be running
31
32

    Then remove bind10 configuration Boss/components value b10-xfrout
33
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
34
    last bindctl output should not contain Error
35

36
37
    # assuming it won't error for further modules (if it does, the final
    # 'should not be running' tests would fail anyway)
38
    Then remove bind10 configuration Boss/components value b10-stats-httpd
39
40
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
    last bindctl output should not contain Error
41

42
    Then remove bind10 configuration Boss/components value b10-stats
43
44
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
    last bindctl output should not contain Error
45

46
    Then remove bind10 configuration Boss/components value b10-zonemgr
47
48
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
    last bindctl output should not contain Error
49

50
    Then remove bind10 configuration Boss/components value b10-xfrin
51
52
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
    last bindctl output should not contain Error
53

54
    Then remove bind10 configuration Boss/components value b10-auth
55
56
    And wait for new bind10 stderr message BIND10_PROCESS_ENDED
    last bindctl output should not contain Error
57

58
    # After these ^^^ have been stopped...
59
60
61
62
    bind10 module Xfrout should not be running
    bind10 module Zonemgr should not be running
    bind10 module Xfrin should not be running
    bind10 module Auth should not be running
63
    bind10 module StatsHttpd should not be running
64
    bind10 module Stats should not be running
65
    bind10 module Resolver should not be running
66
67
68
69
70
71
72

    Scenario: Executing scripts
    # This test tests the 'execute' command, which reads and executes
    # bindctl commands from a file
    Given I have bind10 running with configuration bindctl_commands.config
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
73
74
75
76
77
78
79
80
81
82

    # first a few bad commands
    When I send bind10 the command execute
    last bindctl output should contain Error
    When I send bind10 the command execute file
    last bindctl output should contain Error
    When I send bind10 the command execute file data/commands/nosuchfile
    last bindctl output should contain Error

    # empty list should be no-op
83
84
    When I send bind10 the command execute file data/commands/empty
    last bindctl output should not contain Error
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

    # some tests of directives like !echo and !verbose
    When I send bind10 the command execute file data/commands/directives
    last bindctl output should not contain Error
    last bindctl output should not contain commentexample1
    last bindctl output should contain echoexample
    last bindctl output should contain verbosecommentexample
    last bindctl output should not contain commentexample2

    # bad_command contains a bad command, at which point execution should stop
    When I send bind10 the command execute file data/commands/bad_command
    last bindctl output should contain shouldshow
    last bindctl output should contain Error
    last bindctl output should not contain shouldnotshow

    # nested_command contains another execute script
    When I send bind10 the command execute file data/commands/nested
    last bindctl output should contain shouldshow
    last bindctl output should not contain Error