mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-04 07:55:18 +00:00
[1843] lettuce test for builtin init_authoritative_server
This commit is contained in:
@@ -781,6 +781,7 @@ class BindCmdInterpreter(Cmd):
|
|||||||
The execution is stopped if there are any errors.
|
The execution is stopped if there are any errors.
|
||||||
'''
|
'''
|
||||||
verbose = False
|
verbose = False
|
||||||
|
# TODO: revert local changes on failure
|
||||||
try:
|
try:
|
||||||
for line in commands:
|
for line in commands:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
@@ -128,8 +128,6 @@ def prepare_execute_commands(tool):
|
|||||||
desc="Show the list of commands without executing them"))
|
desc="Show the list of commands without executing them"))
|
||||||
module.add_command(cmd)
|
module.add_command(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tool.add_module_info(module)
|
tool.add_module_info(module)
|
||||||
|
|
||||||
def check_port(option, opt_str, value, parser):
|
def check_port(option, opt_str, value, parser):
|
||||||
|
@@ -559,6 +559,7 @@ class UIModuleCCSession(MultiConfigData):
|
|||||||
" already in " +
|
" already in " +
|
||||||
identifier)
|
identifier)
|
||||||
|
|
||||||
|
|
||||||
def add_value(self, identifier, value_str = None, set_value_str = None):
|
def add_value(self, identifier, value_str = None, set_value_str = None):
|
||||||
"""Add a value to a configuration list. Raises a DataTypeError
|
"""Add a value to a configuration list. Raises a DataTypeError
|
||||||
if the value does not conform to the list_item_spec field
|
if the value does not conform to the list_item_spec field
|
||||||
|
22
tests/lettuce/configurations/bindctl/bindctl.config.orig
Normal file
22
tests/lettuce/configurations/bindctl/bindctl.config.orig
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"Logging": {
|
||||||
|
"loggers": [ {
|
||||||
|
"debuglevel": 99,
|
||||||
|
"severity": "DEBUG",
|
||||||
|
"name": "*"
|
||||||
|
} ]
|
||||||
|
},
|
||||||
|
"Auth": {
|
||||||
|
"database_file": "data/example.org.sqlite3",
|
||||||
|
"listen_on": [ {
|
||||||
|
"port": 47806,
|
||||||
|
"address": "127.0.0.1"
|
||||||
|
} ]
|
||||||
|
},
|
||||||
|
"Boss": {
|
||||||
|
"components": {
|
||||||
|
"b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,6 +1,7 @@
|
|||||||
Feature: control with bindctl
|
Feature: control with bindctl
|
||||||
Assorted tests using bindctl for the administration of BIND 10.
|
Assorted tests using bindctl for the administration of BIND 10.
|
||||||
|
|
||||||
|
|
||||||
Scenario: Removing modules
|
Scenario: Removing modules
|
||||||
# This test runs the original example configuration, which has
|
# This test runs the original example configuration, which has
|
||||||
# a number of modules. It then removes all non-essential modules,
|
# a number of modules. It then removes all non-essential modules,
|
||||||
@@ -64,7 +65,7 @@ Feature: control with bindctl
|
|||||||
bind10 module Stats should not be running
|
bind10 module Stats should not be running
|
||||||
bind10 module Resolver should not be running
|
bind10 module Resolver should not be running
|
||||||
|
|
||||||
Scenario: Executing scripts
|
Scenario: Executing scripts from files
|
||||||
# This test tests the 'execute' command, which reads and executes
|
# This test tests the 'execute' command, which reads and executes
|
||||||
# bindctl commands from a file
|
# bindctl commands from a file
|
||||||
Given I have bind10 running with configuration bindctl_commands.config
|
Given I have bind10 running with configuration bindctl_commands.config
|
||||||
@@ -101,3 +102,48 @@ Feature: control with bindctl
|
|||||||
When I send bind10 the command execute file data/commands/nested
|
When I send bind10 the command execute file data/commands/nested
|
||||||
last bindctl output should contain shouldshow
|
last bindctl output should contain shouldshow
|
||||||
last bindctl output should not contain Error
|
last bindctl output should not contain Error
|
||||||
|
|
||||||
|
# show commands from a file
|
||||||
|
When I send bind10 the command execute file data/commands/bad_command show
|
||||||
|
last bindctl output should not contain Error
|
||||||
|
last bindctl output should contain shouldshow
|
||||||
|
last bindctl output should contain shouldnotshow
|
||||||
|
|
||||||
|
Scenario: Executing builting script init_authoritative_server
|
||||||
|
Given I have bind10 running with configuration bindctl/bindctl.config
|
||||||
|
And wait for bind10 stderr message BIND10_STARTED_CC
|
||||||
|
And wait for bind10 stderr message CMDCTL_STARTED
|
||||||
|
|
||||||
|
When I send bind10 the command execute init_authoritative_server show
|
||||||
|
# just test some parts of the output
|
||||||
|
last bindctl output should contain /Boss/components/b10-auth/special
|
||||||
|
last bindctl output should contain /Boss/components/b10-zonemgr/kind
|
||||||
|
last bindctl output should contain Please
|
||||||
|
|
||||||
|
# nothing should have been changed
|
||||||
|
When I send bind10 the command config diff
|
||||||
|
last bindctl output should contain {}
|
||||||
|
|
||||||
|
# ok now make sure modules aren't running, execute it, and make
|
||||||
|
# sure modules are running
|
||||||
|
bind10 module Auth should not be running
|
||||||
|
bind10 module Xfrout should not be running
|
||||||
|
bind10 module Xfrin should not be running
|
||||||
|
bind10 module Zonemgr should not be running
|
||||||
|
|
||||||
|
When I send bind10 the following commands:
|
||||||
|
"""
|
||||||
|
execute init_authoritative_server
|
||||||
|
config commit
|
||||||
|
"""
|
||||||
|
And wait for bind10 stderr message AUTH_SERVER_STARTED
|
||||||
|
And wait for bind10 stderr message ZONEMGR_STARTED
|
||||||
|
And wait for bind10 stderr message XFRIN_STARTED
|
||||||
|
And wait for bind10 stderr message XFROUT_STARTED
|
||||||
|
|
||||||
|
last bindctl output should not contain Error
|
||||||
|
bind10 module Auth should be running
|
||||||
|
bind10 module Xfrout should be running
|
||||||
|
bind10 module Xfrin should be running
|
||||||
|
bind10 module Zonemgr should be running
|
||||||
|
|
||||||
|
@@ -46,6 +46,8 @@ copylist = [
|
|||||||
"configurations/bindctl_commands.config"],
|
"configurations/bindctl_commands.config"],
|
||||||
["configurations/example.org.config.orig",
|
["configurations/example.org.config.orig",
|
||||||
"configurations/example.org.config"],
|
"configurations/example.org.config"],
|
||||||
|
["configurations/bindctl/bindctl.config.orig",
|
||||||
|
"configurations/bindctl/bindctl.config"],
|
||||||
["configurations/resolver/resolver_basic.config.orig",
|
["configurations/resolver/resolver_basic.config.orig",
|
||||||
"configurations/resolver/resolver_basic.config"],
|
"configurations/resolver/resolver_basic.config"],
|
||||||
["configurations/multi_instance/multi_auth.config.orig",
|
["configurations/multi_instance/multi_auth.config.orig",
|
||||||
|
Reference in New Issue
Block a user