ldap: Add YANG tests

This commit is contained in:
David Pilnik 2023-12-25 16:02:43 +02:00
parent fd753d8ace
commit ebb5155ca4
4 changed files with 94 additions and 0 deletions

View File

@ -163,6 +163,7 @@ setup(
'./yang-models/sonic-system-aaa.yang',
'./yang-models/sonic-system-tacacs.yang',
'./yang-models/sonic-system-radius.yang',
'./yang-models/sonic-system-ldap.yang',
'./yang-models/sonic-telemetry.yang',
'./yang-models/sonic-telemetry_client.yang',
'./yang-models/sonic-gnmi.yang',

View File

@ -1612,6 +1612,22 @@
"timeout": "5"
}
},
"LDAP": {
"global": {
"bind_dn": "test_bind",
"bind_password": "secret",
"bind_timeout": "5",
"version": "3",
"base_dn": "test_base",
"port": "389",
"timeout": "5"
}
},
"LDAP_SERVER": {
"192.168.1.1": {
"priority": "5"
}
},
"NAT_BINDINGS": {
"bind1": {
"nat_pool": "pool1",

View File

@ -0,0 +1,16 @@
{
"LDAP_TABLE": {
"desc": "Configure LDAP global fields."
},
"LDAP_INVALID_TIMEOUT_TEST": {
"desc": "LDAP global configuration with invalid timeout value in LDAP table.",
"eStr": "LDAP timeout must be 1..60"
},
"LDAP_SERVER_TEST" : {
"desc": "LDAP server configuration in LDAP_SERVER table."
},
"LDAP_SERVER_INVALID_PRIORITY_TEST": {
"desc": "LDAP server configuration with invalid priority value in LDAP_SERVER table.",
"eStr": "LDAP server priority must be 1..8"
}
}

View File

@ -0,0 +1,61 @@
{
"LDAP_TABLE": {
"sonic-system-ldap:sonic-system-ldap": {
"sonic-system-ldap:LDAP": {
"global":{
"bind_dn": "test_bind",
"bind_password": "secret",
"bind_timeout": "5",
"version": "3",
"base_dn": "test_base",
"port": "389",
"timeout": "5"
}
}
}
},
"LDAP_INVALID_TIMEOUT_TEST": {
"sonic-system-ldap:sonic-system-ldap": {
"sonic-system-ldap:LDAP": {
"global": {
"bind_dn": "test_bind",
"bind_password": "secret",
"bind_timeout": "5",
"version": "3",
"base_dn": "test_base",
"port": "389",
"timeout": 150
}
}
}
},
"LDAP_SERVER_TEST": {
"sonic-system-ldap:sonic-system-ldap": {
"sonic-system-ldap:LDAP_SERVER": {
"LDAP_SERVER_LIST": [
{
"hostname": "192.168.1.1",
"priority": 1
},
{
"hostname": "ldap_server_1",
"priority": 2
}
]
}
}
},
"LDAP_SERVER_INVALID_PRIORITY_TEST": {
"sonic-system-ldap:sonic-system-ldap": {
"sonic-system-ldap:LDAP_SERVER": {
"LDAP_SERVER_LIST": [
{
"hostname": "192.168.1.1",
"priority": 70
}
]
}
}
}
}