xfrin_notify_handling.feature 15.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
Feature: Xfrin incoming notify handling
    Tests for Xfrin incoming notify handling.

    Scenario: Handle incoming notify
    Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
    And wait for master stderr message BIND10_STARTED_CC
    And wait for master stderr message CMDCTL_STARTED
    And wait for master stderr message AUTH_SERVER_STARTED
    And wait for master stderr message XFROUT_STARTED
    And wait for master stderr message ZONEMGR_STARTED
11
    And wait for master stderr message STATS_STARTING
12
13
14
15
16
17
18
19

    And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
    And wait for bind10 stderr message AUTH_SERVER_STARTED
    And wait for bind10 stderr message XFRIN_STARTED
    And wait for bind10 stderr message ZONEMGR_STARTED

20
    A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
21

22
23
24
25
26
27
28
29
    #
    # Test for statistics
    #
    # check for initial statistics
    #
    When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
    last bindctl output should not contain "error"
    last bindctl output should not contain "example.org."
30
31
32
33
34
35
36
37
38
39
    Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
    Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
    Then the statistics counter xfrrej for the zone _SERVER_ should be 0
    Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0

    When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter ixfr_running should be 0

    When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter axfr_running should be 0
40

41
    When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
42
    Then the statistics counter open should be between 0 and 1
43
44
45
46
47
48
49
50
    Then the statistics counter openfail should be 0
    Then the statistics counter close should be 0
    Then the statistics counter bindfail should be 0
    Then the statistics counter acceptfail should be 0
    Then the statistics counter accept should be 0
    Then the statistics counter senderr should be 0
    Then the statistics counter recverr should be 0

51
52
    When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
    Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
53
    Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
54
55
56
57
58
59
60
61
    # From this point we can't reliably 'wait for new' because the ordering
    # of logs from different processes is unpredictable.  But these
    # should be okay in this case.
    Then wait for bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
    Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
    Then wait for bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
    Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
    Then wait for master stderr message NOTIFY_OUT_REPLY_RECEIVED
62

63
    A query for www.example.org to [::1]:47806 should have rcode NOERROR
64
65
66
    # Make sure handling statistics command handling checked below is
    # after this query
    And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
67
68
69
70
71
72

    #
    # Test for statistics
    #
    # check for statistics change
    #
73
74

    # wait until the last stats requesting is finished
75
76
77
    # note that this does not 100% guarantee the stats updated Xfrout
    # statistics.  But there doesn't seem to be a better log message that
    # suggests this event.
78
79
    wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND

80
81
    When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
    last bindctl output should not contain "error"
82
83
84
85
86
87
88
89
    Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
    Then the statistics counter notifyoutv4 for the zone example.org. should be 0
    Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
    Then the statistics counter notifyoutv6 for the zone example.org. should be 5
    Then the statistics counter xfrrej for the zone _SERVER_ should be 0
    Then the statistics counter xfrrej for the zone example.org. should be 0
    Then the statistics counter xfrreqdone for the zone _SERVER_ should be 1
    Then the statistics counter xfrreqdone for the zone example.org. should be 1
90

91
92
93
94
95
96
97
98
99
100
    When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter open should be 1
    Then the statistics counter openfail should be 0
    Then the statistics counter close should be 0
    Then the statistics counter bindfail should be 0
    Then the statistics counter acceptfail should be 0
    Then the statistics counter accept should be 1
    Then the statistics counter senderr should be 0
    Then the statistics counter recverr should be 0

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
    #
    # Test for Xfr request rejected
    #
    Scenario: Handle incoming notify (XFR request rejected)
    Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
    And wait for master stderr message BIND10_STARTED_CC
    And wait for master stderr message CMDCTL_STARTED
    And wait for master stderr message AUTH_SERVER_STARTED
    And wait for master stderr message XFROUT_STARTED
    And wait for master stderr message ZONEMGR_STARTED
    And wait for master stderr message STATS_STARTING

    And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
    And wait for bind10 stderr message AUTH_SERVER_STARTED
    And wait for bind10 stderr message XFRIN_STARTED
    And wait for bind10 stderr message ZONEMGR_STARTED

    A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN

    #
    # Test1 for statistics
    #
    # check for initial statistics
    #
    When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
    last bindctl output should not contain "error"
    last bindctl output should not contain "example.org."
130
131
132
133
    Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
    Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
    Then the statistics counter xfrrej for the zone _SERVER_ should be 0
    Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
134

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter ixfr_running should be 0

    When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter axfr_running should be 0

    When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter open should be between 0 and 1
    Then the statistics counter openfail should be 0
    Then the statistics counter close should be 0
    Then the statistics counter bindfail should be 0
    Then the statistics counter acceptfail should be 0
    Then the statistics counter accept should be 0
    Then the statistics counter senderr should be 0
    Then the statistics counter recverr should be 0

151
152
153
154
155
156
157
158
159
160
161
162
163
164
    #
    # set transfer_acl rejection
    # Local xfr requests from Xfrin module would be rejected here.
    #
    When I send bind10 the following commands with cmdctl port 47804
    """
    config set Xfrout/zone_config[0]/transfer_acl [{"action":  "REJECT", "from": "::1"}]
    config commit
    """
    last bindctl output should not contain Error

    When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
    Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
    Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
165
166
167
    # can't use 'wait for new' below.
    Then wait for bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
    Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
168
    Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_TRANSFER_SUCCESS
169
170
    Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
    Then wait for master stderr message NOTIFY_OUT_REPLY_RECEIVED
171
172
173
174
175
176
177
178

    A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN

    #
    # Test2 for statistics
    #
    # check for statistics change
    #
179

180
    # wait until stats request at least after NOTIFY_OUT_REPLY_RECEIVED
181
182
    wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND

183
184
    When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
    last bindctl output should not contain "error"
185
186
187
188
    Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
    Then the statistics counter notifyoutv4 for the zone example.org. should be 0
    Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
    Then the statistics counter notifyoutv6 for the zone example.org. should be 5
189
190
    # The counts of rejection would be between 1 and 2. They are not
    # fixed. It would depend on timing or the platform.
191
192
193
194
    Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
    Then the statistics counter xfrrej for the zone example.org. should be greater than 0
    Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
    Then the statistics counter xfrreqdone for the zone example.org. should be 0
195
196
197
198
199
200
201
202
203
204

    When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter open should be 1
    Then the statistics counter openfail should be 0
    Then the statistics counter close should be 0
    Then the statistics counter bindfail should be 0
    Then the statistics counter acceptfail should be 0
    Then the statistics counter accept should be 1
    Then the statistics counter senderr should be 0
    Then the statistics counter recverr should be 0
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

    #
    # Test for unreachable slave
    #
    Scenario: Handle incoming notify (unreachable slave)
    Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
    And wait for master stderr message BIND10_STARTED_CC
    And wait for master stderr message CMDCTL_STARTED
    And wait for master stderr message AUTH_SERVER_STARTED
    And wait for master stderr message XFROUT_STARTED
    And wait for master stderr message ZONEMGR_STARTED
    And wait for master stderr message STATS_STARTING

    When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
    Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
    Then wait for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
    Then wait for new master stderr message NOTIFY_OUT_TIMEOUT

    #
    # Test1 for Xfrout statistics
    #
    # check statistics change
    #

229
    # wait until stats request at least after NOTIFY_OUT_TIMEOUT
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
    wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND

    When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
    last bindctl output should not contain "error"
    Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
    Then the statistics counter notifyoutv4 for the zone example.org. should be 0
    Then the statistics counter notifyoutv6 for the zone _SERVER_ should be greater than 0
    Then the statistics counter notifyoutv6 for the zone example.org. should be greater than 0
    Then the statistics counter xfrrej for the zone _SERVER_ should be 0
    Then the statistics counter xfrrej for the zone example.org. should be 0
    Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
    Then the statistics counter xfrreqdone for the zone example.org. should be 0

    When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
    Then the statistics counter open should be 1
    Then the statistics counter openfail should be 0
    Then the statistics counter close should be 0
    Then the statistics counter bindfail should be 0
    Then the statistics counter acceptfail should be 0
    Then the statistics counter accept should be 0
    Then the statistics counter senderr should be 0
    Then the statistics counter recverr should be 0
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284

    #
    # Test for NOTIFY that would result in NOTAUTH
    #
    Scenario: Handle incoming notify that does match authoritative zones
    Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
    And wait for master stderr message BIND10_STARTED_CC
    And wait for master stderr message CMDCTL_STARTED
    And wait for master stderr message AUTH_SERVER_STARTED
    And wait for master stderr message XFROUT_STARTED
    And wait for master stderr message ZONEMGR_STARTED
    And wait for master stderr message STATS_STARTING

    And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
    And wait for bind10 stderr message AUTH_SERVER_STARTED
    And wait for bind10 stderr message XFRIN_STARTED
    And wait for bind10 stderr message ZONEMGR_STARTED

    #
    # replace master's data source with unmatched zone for slave's zone.
    # we restart Xfrout to make it sure.
    #
    When I send bind10 the following commands with cmdctl port 47804
    """
    config set data_sources/classes/IN[0]/params/database_file data/ixfr-out/zones.sqlite3
    config set Auth/database_file data/ixfr-out/zones.sqlite3
    config set Xfrout/zone_config[0]/origin example.com
    config commit
    Xfrout shutdown
    """
    last bindctl output should not contain "error"
285
    And wait for new master stderr message XFROUT_STARTED
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324

    A query for www.example.com to [::1]:47806 should have rcode REFUSED

    When I send bind10 with cmdctl port 47804 the command Xfrout notify example.com IN
    Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
    Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY_NOTAUTH
    Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED

    A query for www.example.com to [::1]:47806 should have rcode REFUSED

    #
    # Test for NOTIFY that's not in the secondaries list
    #
    Scenario: Handle incoming notify that is not in the secondaries list
    Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
    And wait for master stderr message BIND10_STARTED_CC
    And wait for master stderr message CMDCTL_STARTED
    And wait for master stderr message AUTH_SERVER_STARTED
    And wait for master stderr message XFROUT_STARTED
    And wait for master stderr message ZONEMGR_STARTED
    And wait for master stderr message STATS_STARTING

    And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
    And wait for bind10 stderr message BIND10_STARTED_CC
    And wait for bind10 stderr message CMDCTL_STARTED
    And wait for bind10 stderr message AUTH_SERVER_STARTED
    And wait for bind10 stderr message XFRIN_STARTED
    And wait for bind10 stderr message ZONEMGR_STARTED

    #
    # Empty slave's secondaries list, and restart zonemgr to make it sure
    #
    When I send bind10 the following commands with cmdctl
    """
    config remove Zonemgr/secondary_zones[0]
    config commit
    Zonemgr shutdown
    """
    last bindctl output should not contain "error"
325
    And wait for new bind10 stderr message ZONEMGR_STARTED
326
327
328
329
330
331
332
333
334
335
336

    A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN

    When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
    Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
    Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
    Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
    Then wait for new bind10 stderr message ZONEMGR_ZONE_NOTIFY_NOT_SECONDARY
    Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED

    A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN