Skip to content

Commit bbbd9c1

Browse files
author
Sviatoslav Boichuk
committed
Added Tests for YANG model
1 parent d1c0d84 commit bbbd9c1

4 files changed

Lines changed: 91 additions & 0 deletions

File tree

src/sonic-yang-models/doc/Configuration.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Table of Contents
8585
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
8686
* [RADIUS](#radius)
8787
* [Static DNS](#static-dns)
88+
* [Banner messages](#banner-messages)
8889
* [For Developers](#for-developers)
8990
* [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template)
9091
* [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb)
@@ -2556,6 +2557,24 @@ The DNS_NAMESERVER table introduces static DNS nameservers configuration.
25562557
}
25572558
```
25582559

2560+
### Banner messages
2561+
2562+
The BANNER_MESSAGE table introduces static banner messages configuration.
2563+
2564+
```json
2565+
{
2566+
"BANNER_MESSAGE": {
2567+
"MESSAGE": {
2568+
"state": "enabled",
2569+
"login": "Some login message",
2570+
"motd": "ome message of the day",
2571+
"logout": "Some logout message"
2572+
}
2573+
}
2574+
}
2575+
```
2576+
2577+
25592578
### FIPS
25602579

25612580
The FIPS table introduces FIPS configuration.

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
"vni" : "100"
66
}
77
},
8+
"BANNER_MESSAGE": {
9+
"MESSAGE": {
10+
"state": "enabled",
11+
"login": "Some login message",
12+
"motd": "Some message of the day",
13+
"logout": "Some logout message"
14+
}
15+
},
816
"DHCP_SERVER": {
917
"192.0.0.8": {},
1018
"192.0.0.8": {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"BANNER_MESSAGE_TEST_STATE": {
3+
"desc": "Configure Banner feature state."
4+
},
5+
"BANNER_MESSAGE_TEST_LOGIN" : {
6+
"desc": "Banner login messages configuration in BANNER_MESSAGE table."
7+
},
8+
"BANNER_MESSAGE_TEST_MOTD" : {
9+
"desc": "Banner MOTD messages configuration in BANNER_MESSAGE table."
10+
},
11+
"BANNER_MESSAGE_TEST_LOGOUT" : {
12+
"desc": "Banner logout messages configuration in BANNER_MESSAGE table."
13+
}
14+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"BANNER_MESSAGE_TEST_STATE": {
3+
"sonic-banner:sonic-banner": {
4+
"sonic-banner:BANNER_MESSAGE": {
5+
"MESSAGE": {
6+
"state": "enabled",
7+
"login": "Some login message",
8+
"motd": "Some message of the day",
9+
"logout": "Some logout message"
10+
}
11+
}
12+
}
13+
},
14+
"BANNER_MESSAGE_TEST_LOGIN": {
15+
"sonic-banner:sonic-banner": {
16+
"sonic-banner:BANNER_MESSAGE": {
17+
"MESSAGE": {
18+
"state": "enabled",
19+
"login": "Some login message",
20+
"motd": "Some message of the day",
21+
"logout": "Some logout message"
22+
}
23+
}
24+
}
25+
},
26+
"BANNER_MESSAGE_TEST_MOTD": {
27+
"sonic-banner:sonic-banner": {
28+
"sonic-banner:BANNER_MESSAGE": {
29+
"MESSAGE": {
30+
"state": "enabled",
31+
"login": "Some login message",
32+
"motd": "Some message of the day",
33+
"logout": "Some logout message"
34+
}
35+
}
36+
}
37+
},
38+
"BANNER_MESSAGE_TEST_LOGOUT": {
39+
"sonic-banner:sonic-banner": {
40+
"sonic-banner:BANNER_MESSAGE": {
41+
"MESSAGE": {
42+
"state": "enabled",
43+
"login": "Some login message",
44+
"motd": "Some message of the day",
45+
"logout": "Some logout message"
46+
}
47+
}
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)