|
|
## General Testing assumptions
|
|
|
System tests of configuration backend feature in Kea will be based on requirements page and email/meeting clarifications QA team got over a time of preparations.
|
|
|
* https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-requirements
|
|
|
Scope of this document are just automated system tests (regression) that will be running daily on Kea build farm.
|
|
|
|
|
|
## This document cover just MySQL db backend that will be released with Kea 1.6.0
|
|
|
|
|
|
## Forge core changes
|
|
|
At this point forge create whole different module for different backeds (leases, reservations etc) that creates config files (set of commands) during each individual step of a test. That makes it hard to maintain - every backend has it's own storage, functions to run/upload. New approach (mostly done but not finished yet) is to create class with configuration and module for each backed would use the same class - but different steps to create config files (xml, json, commands)
|
|
|
```
|
|
|
class KeaConfiguration:
|
|
|
def __init__(self):
|
|
|
self.config_type_default = "json"
|
|
|
self.config_type_temporary = "yang"
|
|
|
self.final_config_script = ""
|
|
|
self.destination_address = world.f_cfg.mgmt_address
|
|
|
# create empty lists, there can be multiple pools etc.
|
|
|
self.optionList = []
|
|
|
self.poolList = []
|
|
|
self.subnetList = []
|
|
|
self.sharednetworkList = []
|
|
|
self.optiondefList = []
|
|
|
self.reservationList = []
|
|
|
self.loggerList = [ConfigurationLogging()]
|
|
|
self.classList = []
|
|
|
self.globalparameterList = []
|
|
|
```
|
|
|
That would be easier to maintain multiple backends and add new configuration options.
|
|
|
|
|
|
For building actual configuration simple functions will be used like:
|
|
|
```
|
|
|
def build_xml_script(self):
|
|
|
pass
|
|
|
def build_mysql_script(self):
|
|
|
pass
|
|
|
def build_json_script(self):
|
|
|
pass
|
|
|
```
|
|
|
|
|
|
## Testing approach
|
|
|
1. Upload configuration using `cb_cmds` hook, and check Kea behaviour. Example scenario:
|
|
|
* Create configuration commands
|
|
|
* Execute configuration commands
|
|
|
* Restart Kea (so it perform bootstrapping with db)
|
|
|
* Generate traffic
|
|
|
* Parse response
|
|
|
2. Upload configuration using `cb_cmds` hook and check DB content (using sql select). Example scenario:
|
|
|
* Create configuration commands
|
|
|
* Execute configuration commands
|
|
|
* Execute sql SELECT command
|
|
|
* Parse results
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
* CB MUST be able to store specific parts of the configuration in the database and other parts in the file or other database.
|
|
|
- Changes in JSON file are not detected
|
|
|
- Kea test must assume to have 1 or more storage
|
|
|
- Monitor configuration changes in 1 or more storage
|
|
|
- This brings subject of reconfiguration to complicated situation when kea will use more than one DB:
|
|
|
- tests MUST cover cases when configuration parameter X was removed
|
|
|
- tests MUST cover cases when configuration parameter X was added
|
|
|
- tests MUST cover cases when configuration parameter X was moved from DB 1 to DB 2
|
|
|
- Kea is not supporting storing the same configuration parameters in multiple DB, this is considered as not supported/ configuration error. Not detected (?)
|
|
|
|
|
|
* CB MUST be able to store entire configuration for each Kea daemon
|
|
|
* CB MUST be able to store configuration for all Kea daemons in the same database.
|
|
|
* CB MUST be able to store configuration for respective Kea daemons in separate databases.
|
|
|
* Kea servers MUST be able to learn about configuration changes applied to the database instance
|
|
|
* Some parts of config can overlap
|
|
|
* Kea MUST be able to Bootstrapping amongst multiple databases
|
|
|
* Commands can be passed to database by DHCP or CA
|
|
|
* Kea HAVE TO download and apply just configuration of specific tag
|
|
|
|
|
|
## Kea control commands:
|
|
|
All commands should be tested separately, target of a command can be DHCP or CA daemon, list of commands is available at: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design
|
|
|
|
|
|
|
|
|
===========================================Below not-up-to-date=============
|
|
|
* It MUST be possible to control whether config-get returns the configuration from the Kea config-file or retrieves appropriate configuration from the databases and merges it with the configuration in the config file.
|
|
|
|
|
|
* config-set MUST not overwrite the configuration in the config file if this config refers to the databases storing any part of the configuration. It MUST be possible to overwrite the configuration when explicitly requested via new parameter or another command.
|
|
|
- extend existing system tests
|
|
|
|
|
|
* config-set MUST allow for overwriting the configuration file, without affecting the configuration in the databases.
|
|
|
- extend existing system tests
|
|
|
|
|
|
* config-set MUST allow for overwriting the configuration stored in the databases (follow references to the databases from the configuration file).
|
|
|
- extend existing system tests
|
|
|
|
|
|
* all commands that refer to reconfiguration:
|
|
|
network4-add
|
|
|
network4-del
|
|
|
network4-get
|
|
|
network4-list
|
|
|
network4-subnet-add
|
|
|
network4-subnet-del
|
|
|
network6-add
|
|
|
network6-del
|
|
|
network6-get
|
|
|
network6-list
|
|
|
network6-subnet-add
|
|
|
network6-subnet-del
|
|
|
reservation-add
|
|
|
reservation-del
|
|
|
reservation-get
|
|
|
subnet4-add
|
|
|
subnet4-del
|
|
|
subnet4-get
|
|
|
subnet4-list
|
|
|
subnet6-add
|
|
|
subnet6-del
|
|
|
subnet6-get
|
|
|
subnet6-list
|
|
|
should be working with configured database.
|
|
|
- If Kea will use database configured in JSON file then:
|
|
|
- Existing system tests should be sufficient and report the same result as JSON only configuration
|
|
|
- else:
|
|
|
- Existing system tests MUST be extended with exact copy of them but with additional argument in used command.
|
|
|
|
|
|
## Forge extensions:
|
|
|
* ability to use kea daemon to upload configuration to MySQL, Postgres and Netconf (testing plan: https://gitlab.isc.org/isc-projects/kea/wikis/Test-Plans/NETCONF)
|
|
|
* ability to set default CB and ability to choose it from test level - multiple times
|
|
|
* repeat existing tests for each CB
|
|
|
* add tests for multiple CB and changes detection in DB
|
|
|
* future: extend forge to be able to create SQL commands to avoid using kea daemon for configuration. |
|
|
\ No newline at end of file |