Skip to content

Commit

Permalink
Add yang model unit test for check_up_status field type (#11243)
Browse files Browse the repository at this point in the history
#### Why I did it
To address #11110 - Add yang model unit test for check_up_status field type

#### How I did it
Add check_up_status with different values in sample_config_db.json and
the field with correct and incorrect values in feature.json

#### How to verify it
Build sonic_yang_models-1.0-py3-none-any.whl
  • Loading branch information
sg893052 authored Jun 29, 2022
1 parent 05f1c6f commit dbc6681
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
21 changes: 14 additions & 7 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,8 @@
"has_timer": "False",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "False"
},
"database": {
"auto_restart": "always_enabled",
Expand All @@ -1474,7 +1475,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "always_enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"snmp": {
"auto_restart": "enabled",
Expand All @@ -1483,7 +1485,8 @@
"has_timer": "true",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "true"
},
"swss": {
"auto_restart": "enabled",
Expand All @@ -1492,7 +1495,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"syncd": {
"auto_restart": "enabled",
Expand All @@ -1501,7 +1505,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"lldp": {
"auto_restart": "enabled",
Expand All @@ -1510,7 +1515,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
"dhcp_relay": {
"auto_restart": "enabled",
Expand All @@ -1519,7 +1525,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != 'ToRRouter') %}enabled{% else %}disabled{% endif %}",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "true"
}
},
"DHCP_RELAY": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"has_timer": "False",
"has_global_scope": "True",
"has_per_asic_scope": "True",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "False"
},
{
"name": "swss",
Expand All @@ -19,7 +20,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
{
"name": "syncd",
Expand All @@ -28,7 +30,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
{
"name": "snmp",
Expand All @@ -37,7 +40,8 @@
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "false",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
{
"name": "lldp",
Expand All @@ -46,7 +50,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
{
"name": "dhcp_relay",
Expand All @@ -55,7 +60,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
}
]
}
Expand All @@ -72,7 +78,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "invalid"
"set_owner": "invalid",
"check_up_status": "false"
}
]
}
Expand All @@ -88,7 +95,8 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"check_up_status": "false"
}
]
}
Expand All @@ -104,7 +112,8 @@
"auto_restart": "always_enabled",
"has_timer": "FALSE",
"has_global_scope": "TRUE",
"has_per_asic_scope": "TRUE"
"has_per_asic_scope": "TRUE",
"check_up_status": "FALSE"
}
]
}
Expand Down

0 comments on commit dbc6681

Please sign in to comment.