diff options
| author | Shon Feder <abathologist@gmail.com> | 2017-01-17 03:31:28 -0500 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2017-01-17 15:31:28 +0700 |
| commit | 27a2d5ad1afb7baac317672620ff138f9802ccbf (patch) | |
| tree | f5aa5c1677a6a23b65d213de8cfd35a7b268aa08 /test/data/interface_definitions | |
| parent | ee79ba2a593e45ff942554440bb8859ee3228a4b (diff) | |
| download | vyconf-27a2d5ad1afb7baac317672620ff138f9802ccbf.tar.gz vyconf-27a2d5ad1afb7baac317672620ff138f9802ccbf.zip | |
T231: Add a function for loading interface definitions from a directory (#5)
* T231: Load directory of interface definitions
* T231: Add ounit package to merlin config
* T231: Add tests for loading dir of definitions
* squash! T231: Load directory of interface definitions
* squash! T231: Add tests for loading dir of definitions
Diffstat (limited to 'test/data/interface_definitions')
| -rw-r--r-- | test/data/interface_definitions/login_sample.xml | 23 | ||||
| -rw-r--r-- | test/data/interface_definitions/system_sample.xml | 63 |
2 files changed, 86 insertions, 0 deletions
diff --git a/test/data/interface_definitions/login_sample.xml b/test/data/interface_definitions/login_sample.xml new file mode 100644 index 0000000..b74a415 --- /dev/null +++ b/test/data/interface_definitions/login_sample.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="login" owner="login"> + <children> + <tagNode name="user"> + <properties> + <help>User name</help> + <constraint> + <regex>[a-z][a-zA-Z0-9]+</regex> + </constraint> + <constraintErrorMessage>User name must start with a letter and consist of letters and digits</constraintErrorMessage> + </properties> + <children> + <leafNode name="full-name"> + <properties> + <help>User full name</help> + </properties> + </leafNode> + </children> + </tagNode> + </children> + </node> +</interfaceDefinition> diff --git a/test/data/interface_definitions/system_sample.xml b/test/data/interface_definitions/system_sample.xml new file mode 100644 index 0000000..c6185c0 --- /dev/null +++ b/test/data/interface_definitions/system_sample.xml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="system"> + <children> + <node name="login" owner="login"> + <children> + <tagNode name="user"> + <keepChildOrder/> + <properties> + <help>User name</help> + <constraint> + <regex>[a-zA-Z][a-zA-Z0-9\-]+</regex> + </constraint> + <constraintErrorMessage>User name must start with a letter and consist of letters and digits</constraintErrorMessage> + </properties> + <children> + <leafNode name="full-name"> + <properties> + <help>User full name</help> + </properties> + </leafNode> + </children> + </tagNode> + <leafNode name="password"> + <properties> + <help>A password</help> + <secret/> + </properties> + </leafNode> + </children> + </node> + <leafNode name="host-name"> + <properties> + <constraint> + <regex>[a-zA-Z][a-zA-Z0-9\-]</regex> + </constraint> + </properties> + </leafNode> + <leafNode name="ntp-server"> + <properties> + <help>NTP server address</help> + <multi/> + </properties> + </leafNode> + <node name="options"> + <children> + <leafNode name="reboot-on-panic"> + <properties> + <help>Reboot automatically if kernel panic occurs</help> + <valueless/> + </properties> + </leafNode> + <leafNode name="enable-dangerous-features"> + <properties> + <help>Enable dangerous features</help> + <hidden/> + </properties> + </leafNode> + </children> + </node> + </children> + </node> +</interfaceDefinition> |
