[yang]: Split yang tests into multiple files (#6939)

* Add manageability to the yang model tests by splitting the tests
and config data for the tests into multiple files.

The "tests" directory contains all the tests and the "tests_config"
directory contains the configs used for the tests.

New tests can be added in new json files.

Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
This commit is contained in:
joyas-joseph 2021-03-31 10:58:13 -07:00 committed by GitHub
parent 50f3be5259
commit 0b64dc30d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 1902 additions and 1734 deletions

View File

@ -49,304 +49,25 @@ class Test_yang_models:
'None': []
}
self.ExceptionTests = {
'WRONG_FAMILY_WITH_IP_PREFIX': {
'desc': 'Configure Wrong family with ip-prefix for VLAN_Interface Table',
'eStr': self.defaultYANGFailure['Must']
},
'DHCP_SERVER_INCORRECT_FORMAT': {
'desc': 'Add dhcp_server which is not in correct ip-prefix format.',
'eStr': self.defaultYANGFailure['InvalidValue'] + ['dhcp_servers']
},
'VLAN_WITH_NON_EXIST_PORT': {
'desc': 'Configure a member port in VLAN_MEMBER table which does not exist.',
'eStr': self.defaultYANGFailure['LeafRef']
},
'PORT_CHANNEL_TEST': {
'desc': 'Configure a member port in PORT_CHANNEL table.',
'eStr': self.defaultYANGFailure['None']
},
'PORTCHANNEL_MEMEBER_WITH_NON_EXIST_PORTCHANNEL': {
'desc': 'Configure PortChannel in PORTCHANNEL_MEMEBER table \
which does not exist in PORTCHANNEL table.',
'eStr': self.defaultYANGFailure['LeafRef'] + \
['portchannel', 'name']
},
'PORTCHANNEL_MEMEBER_WITH_NON_EXIST_PORT': {
'desc': 'Configure Port in PORTCHANNEL_MEMEBER table \
which does not exist in PORT table.',
'eStr': self.defaultYANGFailure['LeafRef'] + \
['port', 'name']
},
'PORTCHANNEL_INTERFACE_IP_ADDR_TEST': {
'desc': 'Configure IP address on PORTCHANNEL_INTERFACE table.',
'eStr': self.defaultYANGFailure['None']
},
'PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO': {
'desc': 'Configure IP address on a non existent PortChannel.',
'eStr': self.defaultYANGFailure['LeafRef']
},
'VLAN_MEMEBER_WITH_NON_EXIST_VLAN': {
'desc': 'Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.',
'eStr': self.defaultYANGFailure['LeafRef']
},
'TAGGING_MODE_WRONG_VALUE': {
'desc': 'Configure wrong value for tagging_mode.',
'eStr': self.defaultYANGFailure['InvalidValue'] + ['tagging_mode']
},
'INTERFACE_IP_PREFIX_EMPTY_STRING': {
'desc': 'Configure empty string as ip-prefix in INTERFACE table.',
'eStr': self.defaultYANGFailure['InvalidValue'] + ['ip-prefix']
},
'ACL_RULE_UNDEFINED_PACKET_ACTION': {
'desc': 'Configure undefined packet_action in ACL_RULE table.',
'eStr': self.defaultYANGFailure['InvalidValue'] + ['PACKET_ACTION']
},
'ACL_TABLE_EMPTY_PORTS': {
'desc': 'Configure ACL_TABLE with empty ports.',
'eStr': self.defaultYANGFailure['None']
},
'ACL_TABLE_UNDEFINED_TABLE_TYPE': {
'desc': 'Configure undefined acl_table_type in ACL_TABLE table.',
'eStr': self.defaultYANGFailure['InvalidValue'] + ['type']
},
'ACL_RULE_WITH_NON_EXIST_ACL_TABLE': {
'desc': 'Configure non-existing ACL_TABLE in ACL_RULE.',
'eStr': self.defaultYANGFailure['LeafRef']
},
'ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH': {
'desc': 'Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.',
'eStr': self.defaultYANGFailure['When'] + ['IP_TYPE']
},
'ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH': {
'desc': 'Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.',
'eStr': self.defaultYANGFailure['When'] + ['IP_TYPE']
},
'ACL_RULE_WRONG_L4_SRC_PORT_RANGE': {
'desc': 'Configure l4_src_port_range as 99999-99999 in ACL_RULE',
'eStr': self.defaultYANGFailure['Pattern']
},
'ACL_RULE_ARP_TYPE_ICMPV6_CODE_MISMATCH': {
'desc': 'Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE.',
'eStr': self.defaultYANGFailure['When'] + ['IP_TYPE']
},
'ACL_RULE_WRONG_INNER_ETHER_TYPE': {
'desc': 'Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE.',
'eStr': self.defaultYANGFailure['Pattern']
},
'INTERFACE_IPPREFIX_PORT_MUST_CONDITION_FALSE': {
'desc': 'Interface Ip-prefix port-name must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'INTERFACE_IPPREFIX_PORT_MUST_CONDITION_TRUE': {
'desc': 'Interface Ip-prefix port-name must condition pass.',
'eStr': self.defaultYANGFailure['None']
},
'VLAN_INTERFACE_IPPREFIX_MUST_CONDITION_FALSE': {
'desc': 'Vlan Interface Ip-prefix must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'LOOPBACK_IPPREFIX_PORT_MUST_CONDITION_FALSE': {
'desc': 'Loopback Ip-prefix port-name must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'CRM_BRK_CFG_FLEX_TABLE': {
'desc': 'CRM BREAKOUT CFG FLEX COUNTER TABLE.',
'eStr': self.defaultYANGFailure['None']
},
'DEV_META_DEV_NEIGH_VERSION_TABLE': {
'desc': 'DEVICE_METADATA DEVICE_NEIGHBOR VERSION TABLE.',
'eStr': self.defaultYANGFailure['None']
},
'INCORRECT_VLAN_NAME': {
'desc': 'INCORRECT VLAN_NAME FIELD IN VLAN TABLE.',
'eStr': self.defaultYANGFailure['Pattern'] + ["Vlan"]
},
'ACL_TABLE_MANDATORY_TYPE': {
'desc': 'ACL_TABLE MANDATORY TYPE FIELD.',
'eStr': self.defaultYANGFailure['Mandatory'] + ['type'] + ['ACL_TABLE']
},
'ACL_TABLE_DEFAULT_VALUE_STAGE': {
'desc': 'ACL_TABLE DEFAULT VALUE FOR STAGE FIELD.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME",
'key': 'sonic-acl:stage',
'value': 'INGRESS'
}
},
'INCORRECT_VLAN_NAME': {
'desc': 'INCORRECT VLAN_NAME FIELD IN VLAN TABLE.',
'eStr': self.defaultYANGFailure['Pattern'] + ["Vlan"]
},
'PORT_CHANNEL_WRONG_PATTERN': {
'desc': 'INCORRECT PORTCHANNEL_NAME IN PORT_CHANNEL TABLE.',
'eStr': self.defaultYANGFailure['Pattern'] + ["PortChannel"]
},
'ACL_TABLE_STAGE_SERVICES': {
'desc': 'ACL_TABLE LOAD STAGE SERVICES SUCCESSFULLY.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME",
'key': 'sonic-acl:services',
'value': ["SNMP"]
}
},
'PORT_TEST': {
'desc': 'LOAD PORT TABLE WITH FEC AND PFC_ASYM SUCCESSFULLY. VERIFY PFC_ASYM.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': "/sonic-port:sonic-port/PORT/PORT_LIST[name='Ethernet8']/name",
'key': 'sonic-port:pfc_asym',
'value': 'on'
}
},
'PORT_NEG_TEST': {
'desc': 'LOAD PORT TABLE FEC PATTERN FAILURE',
'eStr': self.defaultYANGFailure['Pattern'] + ['rc']
},
'PORT_VALID_AUTONEG_TEST_1': {
'desc': 'PORT_VALID_AUTONEG_TEST_1 no failure.',
'eStr': self.defaultYANGFailure['None']
},
'PORT_VALID_AUTONEG_TEST_2': {
'desc': 'PORT_VALID_AUTONEG_TEST_2 no failure.',
'eStr': self.defaultYANGFailure['None']
},
'PORT_INVALID_AUTONEG_TEST': {
'desc': 'PORT_INVALID_AUTONEG_TEST must condition failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['on|off']
},
'CRM_WITH_WRONG_PERCENTAGE': {
'desc': 'CRM_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'CRM_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'CRM_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'CRM_WITH_CORRECT_FREE_VALUE': {
'desc': 'CRM_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'CRM_WITH_CORRECT_USED_VALUE': {
'desc': 'CRM_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'CRM_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE': {
'desc': 'FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'VERSIONS_WITH_INCORRECT_PATTERN': {
'desc': 'VERSIONS_WITH_INCORRECT_PATTERN pattern failure.',
'eStr': self.defaultYANGFailure['Pattern']
},
'VERSIONS_WITH_INCORRECT_PATTERN2': {
'desc': 'VERSIONS_WITH_INCORRECT_PATTERN pattern failure.',
'eStr': self.defaultYANGFailure['Pattern']
},
'DEVICE_METADATA_DEFAULT_BGP_STATUS': {
'desc': 'DEVICE_METADATA DEFAULT VALUE FOR BGP_STATUS FIELD.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': '/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname',
'key': 'sonic-device_metadata:default_bgp_status',
'value': 'up'
}
},
'DEVICE_METADATA_DEFAULT_DOCKER_ROUTING_CONFIG_MODE': {
'desc': 'DEVICE_METADATA DEFAULT VALUE FOR DOCKER_ROUTING_CONFIG_MODE FIELD.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': '/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname',
'key': 'sonic-device_metadata:docker_routing_config_mode',
'value': 'unified'
}
},
'DEVICE_METADATA_DEFAULT_PFCWD_STATUS': {
'desc': 'DEVICE_METADATA DEFAULT VALUE FOR PFCWD FIELD.',
'eStr': self.defaultYANGFailure['Verify'],
'verify': {'xpath': '/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname',
'key': 'sonic-device_metadata:default_pfcwd_status',
'value': 'disable'
}
},
'DEVICE_METADATA_TYPE_INCORRECT_PATTERN': {
'desc': 'DEVICE_METADATA_TYPE_INCORRECT_PATTERN pattern failure.',
'eStr': self.defaultYANGFailure['Pattern']
},
'BREAKOUT_CFG_CORRECT_MODES': {
'desc': 'BREAKOUT_CFG correct breakout modes',
'eStr': self.defaultYANGFailure['None']
},
'BREAKOUT_CFG_INCORRECT_MODES': {
'desc': 'BREAKOUT_CFG wrong breakout modes',
'eStr': self.defaultYANGFailure['Pattern']
},
'SNAT_WITH_WRONG_PERCENTAGE': {
'desc': 'SNAT_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'SNAT_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'SNAT_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'SNAT_WITH_CORRECT_FREE_VALUE': {
'desc': 'SNAT_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'SNAT_WITH_CORRECT_USED_VALUE': {
'desc': 'SNAT_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'SNAT_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'DNAT_WITH_WRONG_PERCENTAGE': {
'desc': 'DNAT_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'DNAT_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'DNAT_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'DNAT_WITH_CORRECT_FREE_VALUE': {
'desc': 'DNAT_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'DNAT_WITH_CORRECT_USED_VALUE': {
'desc': 'DNAT_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'DNAT_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'IPMC_WITH_WRONG_PERCENTAGE': {
'desc': 'IPMC_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'IPMC_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'IPMC_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'IPMC_WITH_CORRECT_FREE_VALUE': {
'desc': 'IPMC_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'IPMC_WITH_CORRECT_USED_VALUE': {
'desc': 'IPMC_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'IPMC_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
}
}
self.ExceptionTests = { }
for test_file in glob("./tests/yang_model_tests/tests/*.json"):
try:
with open(test_file) as fp:
log.info("Loading file " + test_file)
data = json.load(fp)
for key, test in data.items():
eStr = []
if 'eStrKey' in test:
eStr = list(self.defaultYANGFailure[test['eStrKey']])
if 'eStr' in test:
eStr += list(test['eStr'])
test['eStr'] = eStr
log.debug("estr for " + key + " is " + str(eStr))
self.ExceptionTests[key] = test
except Exception as e:
log.error("Failed to load file " + test_file)
raise(e)
self.SpecialTests = {
'ALL_VLAN_TEST': {
@ -357,7 +78,19 @@ class Test_yang_models:
self.tests = list(self.ExceptionTests.keys())+list(self.SpecialTests.keys())
self.yangDir = './yang-models/'
self.jsonFile = './tests/yang_model_tests/yangTest.json'
self.testFile = {}
for test_file in glob("./tests/yang_model_tests/tests_config/*.json"):
try:
with open(test_file) as fp:
log.info("Loading file " + test_file)
data = json.load(fp)
for key in data:
self.testFile[key] = test_file
except Exception as e:
log.error("Failed to load file " + test_file)
raise(e)
self.testNum = 1
# other class vars
# self.ctx
@ -397,7 +130,8 @@ class Test_yang_models:
# this is to avoid loading very large JSON in memory
log.debug(" Read JSON Section: " + test)
jInput = ""
with open(self.jsonFile, 'rb') as f:
test_file = self.testFile[test]
with open(test_file, 'rb') as f:
jInst = ijson.items(f, test)
for it in jInst:
jInput = jInput + json.dumps(it)
@ -463,8 +197,11 @@ class Test_yang_models:
jInput = self.readJsonInput(test)
# load the data, expect a exception with must condition failure
s = self.loadConfigData(jInput, self.ExceptionTests[test].get('verify'))
eStr = self.ExceptionTests[test]['eStr']
log.debug("eStr: {}".format(eStr))
log.debug("s: {}".format(s))
if len(eStr) == 0 and s != "":
raise Exception("{} in not empty".format(s))
elif (sum(1 for str in eStr if str not in s) == 0):

View File

@ -0,0 +1,65 @@
{
"ACL_RULE_UNDEFINED_PACKET_ACTION": {
"desc": "Configure undefined packet_action in ACL_RULE table.",
"eStrKey" : "InvalidValue",
"eStr": ["PACKET_ACTION"]
},
"ACL_TABLE_EMPTY_PORTS": {
"desc": "Configure ACL_TABLE with empty ports."
},
"ACL_TABLE_UNDEFINED_TABLE_TYPE": {
"desc": "Configure undefined acl_table_type in ACL_TABLE table.",
"eStrKey" : "InvalidValue",
"eStr": ["type"]
},
"ACL_RULE_WITH_NON_EXIST_ACL_TABLE": {
"desc": "Configure non-existing ACL_TABLE in ACL_RULE.",
"eStrKey" : "LeafRef"
},
"ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH": {
"desc": "Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.",
"eStrKey" : "When",
"eStr": ["IP_TYPE"]
},
"ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH": {
"desc": "Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.",
"eStrKey" : "When",
"eStr": ["IP_TYPE"]
},
"ACL_RULE_WRONG_L4_SRC_PORT_RANGE": {
"desc": "Configure l4_src_port_range as 99999-99999 in ACL_RULE",
"eStrKey" : "Pattern"
},
"ACL_RULE_ARP_TYPE_ICMPV6_CODE_MISMATCH": {
"desc": "Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE.",
"eStrKey" : "When",
"eStr": ["IP_TYPE"]
},
"ACL_RULE_WRONG_INNER_ETHER_TYPE": {
"desc": "Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE.",
"eStrKey" : "Pattern"
},
"ACL_TABLE_MANDATORY_TYPE": {
"desc": "ACL_TABLE MANDATORY TYPE FIELD.",
"eStrKey" : "Mandatory",
"eStr": ["ACL_TABLE"]
},
"ACL_TABLE_DEFAULT_VALUE_STAGE": {
"desc": "ACL_TABLE DEFAULT VALUE FOR STAGE FIELD.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME",
"key": "sonic-acl:stage",
"value": "INGRESS"
}
},
"ACL_TABLE_STAGE_SERVICES": {
"desc": "ACL_TABLE LOAD STAGE SERVICES SUCCESSFULLY.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME",
"key": "sonic-acl:services",
"value": ["SNMP"]
}
}
}

View File

@ -0,0 +1,12 @@
{
"BREAKOUT_CFG_CORRECT_MODES": {
"desc": "BREAKOUT_CFG correct breakout modes"
},
"BREAKOUT_CFG_INCORRECT_MODES": {
"desc": "BREAKOUT_CFG wrong breakout modes",
"eStr": ["pattern", "does not satisfy"]
},
"CRM_BRK_CFG_FLEX_TABLE": {
"desc": "CRM BREAKOUT CFG FLEX COUNTER TABLE."
}
}

View File

@ -0,0 +1,81 @@
{
"CRM_WITH_CORRECT_FREE_VALUE": {
"desc": "CRM_WITH_CORRECT_FREE_VALUE no failure."
},
"CRM_WITH_CORRECT_USED_VALUE": {
"desc": "CRM_WITH_CORRECT_USED_VALUE no failure."
},
"CRM_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"CRM_WITH_WRONG_PERCENTAGE": {
"desc": "CRM_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"CRM_WITH_HIGH_THRESHOLD_ERR": {
"desc": "CRM_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"CRM_WITH_CORRECT_USED_VALUE": {
"desc": "CRM_WITH_CORRECT_USED_VALUE no failure."
},
"SNAT_WITH_WRONG_PERCENTAGE": {
"desc": "SNAT_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"SNAT_WITH_HIGH_THRESHOLD_ERR": {
"desc": "SNAT_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": [ "high_threshold should be more than low_threshold" ]
},
"SNAT_WITH_CORRECT_FREE_VALUE": {
"desc": "SNAT_WITH_CORRECT_FREE_VALUE no failure."
},
"SNAT_WITH_CORRECT_USED_VALUE": {
"desc": "SNAT_WITH_CORRECT_USED_VALUE no failure."
},
"SNAT_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"DNAT_WITH_WRONG_PERCENTAGE": {
"desc": "DNAT_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"DNAT_WITH_HIGH_THRESHOLD_ERR": {
"desc": "DNAT_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": [ "high_threshold should be more than low_threshold" ]
},
"DNAT_WITH_CORRECT_FREE_VALUE": {
"desc": "DNAT_WITH_CORRECT_FREE_VALUE no failure."
},
"DNAT_WITH_CORRECT_USED_VALUE": {
"desc": "DNAT_WITH_CORRECT_USED_VALUE no failure."
},
"DNAT_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"IPMC_WITH_WRONG_PERCENTAGE": {
"desc": "IPMC_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"IPMC_WITH_HIGH_THRESHOLD_ERR": {
"desc": "IPMC_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": [ "high_threshold should be more than low_threshold" ]
},
"IPMC_WITH_CORRECT_FREE_VALUE": {
"desc": "IPMC_WITH_CORRECT_FREE_VALUE no failure."
},
"IPMC_WITH_CORRECT_USED_VALUE": {
"desc": "IPMC_WITH_CORRECT_USED_VALUE no failure."
},
"IPMC_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
}
}

View File

@ -0,0 +1,36 @@
{
"DEV_META_DEV_NEIGH_VERSION_TABLE": {
"desc": "DEVICE_METADATA DEVICE_NEIGHBOR VERSION TABLE."
},
"DEVICE_METADATA_DEFAULT_BGP_STATUS": {
"desc": "DEVICE_METADATA DEFAULT VALUE FOR BGP_STATUS FIELD.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname",
"key": "sonic-device_metadata:default_bgp_status",
"value": "up"
}
},
"DEVICE_METADATA_DEFAULT_DOCKER_ROUTING_CONFIG_MODE": {
"desc": "DEVICE_METADATA DEFAULT VALUE FOR DOCKER_ROUTING_CONFIG_MODE FIELD.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname",
"key": "sonic-device_metadata:docker_routing_config_mode",
"value": "unified"
}
},
"DEVICE_METADATA_DEFAULT_PFCWD_STATUS": {
"desc": "DEVICE_METADATA DEFAULT VALUE FOR PFCWD FIELD.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname",
"key": "sonic-device_metadata:default_pfcwd_status",
"value": "disable"
}
},
"DEVICE_METADATA_TYPE_INCORRECT_PATTERN": {
"desc": "DEVICE_METADATA_TYPE_INCORRECT_PATTERN pattern failure.",
"eStrKey" : "Pattern"
}
}

View File

@ -0,0 +1,5 @@
{
"FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE": {
"desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure."
}
}

View File

@ -0,0 +1,14 @@
{
"INTERFACE_IP_PREFIX_EMPTY_STRING": {
"desc": "Configure empty string as ip-prefix in INTERFACE table.",
"eStrKey": "InvalidValue",
"eStr": ["ip-prefix"]
},
"INTERFACE_IPPREFIX_PORT_MUST_CONDITION_FALSE": {
"desc": "Interface Ip-prefix port-name must condition failure.",
"eStrKey": "Must"
},
"INTERFACE_IPPREFIX_PORT_MUST_CONDITION_TRUE": {
"desc": "Interface Ip-prefix port-name must condition pass."
}
}

View File

@ -0,0 +1,6 @@
{
"LOOPBACK_IPPREFIX_PORT_MUST_CONDITION_FALSE": {
"desc": "Loopback Ip-prefix port-name must condition failure.",
"eStrKey" : "Must"
}
}

View File

@ -0,0 +1,27 @@
{
"PORT_TEST": {
"desc": "LOAD PORT TABLE WITH FEC AND PFC_ASYM SUCCESSFULLY. VERIFY PFC_ASYM.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-port:sonic-port/PORT/PORT_LIST[name='Ethernet8']/name",
"key": "sonic-port:pfc_asym",
"value": "on"
}
},
"PORT_NEG_TEST": {
"desc": "LOAD PORT TABLE FEC PATTERN FAILURE",
"eStrKey" : "Pattern",
"eStr": ["rc"]
},
"PORT_VALID_AUTONEG_TEST_1": {
"desc": "PORT_VALID_AUTONEG_TEST_1 no failure."
},
"PORT_VALID_AUTONEG_TEST_2": {
"desc": "PORT_VALID_AUTONEG_TEST_2 no failure."
},
"PORT_INVALID_AUTONEG_TEST": {
"desc": "PORT_INVALID_AUTONEG_TEST must condition failure.",
"eStrKey" : "Pattern",
"eStr": ["on|off"]
}
}

View File

@ -0,0 +1,27 @@
{
"PORT_CHANNEL_TEST": {
"desc": "Configure a member port in PORT_CHANNEL table."
},
"PORT_CHANNEL_WRONG_PATTERN": {
"desc": "INCORRECT PORTCHANNEL_NAME IN PORT_CHANNEL TABLE.",
"eStrKey" : "Pattern",
"eStr": ["PortChannel"]
},
"PORTCHANNEL_INTERFACE_IP_ADDR_TEST": {
"desc": "Configure IP address on PORTCHANNEL_INTERFACE table."
},
"PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO": {
"desc": "Configure IP address on a non existent PortChannel.",
"eStrKey": "LeafRef"
},
"PORTCHANNEL_MEMBER_WITH_NON_EXIST_PORTCHANNEL": {
"desc": "Configure PortChannel in PORTCHANNEL_MEMEBER table which does not exist in PORTCHANNEL table.",
"eStrKey": "LeafRef",
"eStr": ["portchannel", "name"]
},
"PORTCHANNEL_MEMBER_WITH_NON_EXIST_PORT": {
"desc": "Configure Port in PORTCHANNEL_MEMEBER table which does not exist in PORT table.",
"eStrKey": "LeafRef",
"eStr": ["port", "name"]
}
}

View File

@ -0,0 +1,10 @@
{
"VERSIONS_WITH_INCORRECT_PATTERN": {
"desc": "VERSIONS_WITH_INCORRECT_PATTERN pattern failure.",
"eStrKey" : "Pattern"
},
"VERSIONS_WITH_INCORRECT_PATTERN2": {
"desc": "VERSIONS_WITH_INCORRECT_PATTERN pattern failure.",
"eStrKey" : "Pattern"
}
}

View File

@ -0,0 +1,33 @@
{
"VLAN_INTERFACE_IPPREFIX_MUST_CONDITION_FALSE": {
"desc": "Vlan Interface Ip-prefix must condition failure.",
"eStrKey" : "Must"
},
"INCORRECT_VLAN_NAME": {
"desc": "INCORRECT VLAN_NAME FIELD IN VLAN TABLE.",
"eStrKey" : "Pattern",
"eStr": ["Vlan"]
},
"WRONG_FAMILY_WITH_IP_PREFIX": {
"desc": "Configure Wrong family with ip-prefix for VLAN_Interface Table",
"eStrKey" : "Must"
},
"DHCP_SERVER_INCORRECT_FORMAT": {
"desc": "Add dhcp_server which is not in correct ip-prefix format.",
"eStrKey" : "InvalidValue",
"eStr": ["dhcp_servers"]
},
"VLAN_WITH_NON_EXIST_PORT": {
"desc": "Configure a member port in VLAN_MEMBER table which does not exist.",
"eStrKey" : "LeafRef"
},
"VLAN_MEMEBER_WITH_NON_EXIST_VLAN": {
"desc": "Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.",
"eStrKey" : "LeafRef"
},
"TAGGING_MODE_WRONG_VALUE": {
"desc": "Configure wrong value for tagging_mode.",
"eStrKey" : "InvalidValue",
"eStr": ["tagging_mode"]
}
}

View File

@ -0,0 +1,475 @@
{
"ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"DST_IPV6": "2001::2/64",
"IP_TYPE": "ARP",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999980,
"RULE_NAME": "Rule_20"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3V6"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_ARP_TYPE_ICMPV6_CODE_MISMATCH": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"DST_IP": "10.186.72.64/26",
"ICMPV6_CODE": 5,
"INNER_ETHER_TYPE": "0x88CC",
"IP_TYPE": "ARP",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999960,
"RULE_NAME": "Rule_40",
"SRC_IP": "10.176.0.0/15"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"IP_TYPE": "IPv4ANY",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999980,
"RULE_NAME": "Rule_20",
"SRC_IPV6": "2001::1/64"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_UNDEFINED_PACKET_ACTION": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"DST_IP": "10.186.72.0/26",
"IP_TYPE": "IPv4ANY",
"PACKET_ACTION": "SEND",
"PRIORITY": 999980,
"RULE_NAME": "Rule_20",
"SRC_IP": "10.176.0.0/15"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_WITH_NON_EXIST_ACL_TABLE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NOT-EXIST",
"DST_IP": "10.186.72.0/26",
"IP_TYPE": "IPv4ANY",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999980,
"RULE_NAME": "Rule_20",
"SRC_IP": "10.176.0.0/15"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_WRONG_INNER_ETHER_TYPE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"DST_IP": "10.186.72.64/26",
"INNER_ETHER_TYPE": "0x080C",
"IP_TYPE": "ARP",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999960,
"RULE_NAME": "Rule_40",
"SRC_IP": "10.176.0.0/15"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_WRONG_L4_SRC_PORT_RANGE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"DST_IPV6": "2a04:f547:43:320::/64",
"IP_TYPE": "IP",
"L4_SRC_PORT_RANGE": "99999-99999",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 999980,
"RULE_NAME": "Rule_20",
"SRC_IPV6": "2a04:f547:41::/48"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3V6"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_DEFAULT_VALUE_STAGE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"type": "L3"
}
]
}
}
},
"ACL_TABLE_EMPTY_PORTS": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
""
],
"stage": "EGRESS",
"type": "L3"
}
]
}
}
},
"ACL_TABLE_MANDATORY_TYPE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"stage": "EGRESS"
}
]
}
}
},
"ACL_TABLE_STAGE_SERVICES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"services": [
"SNMP"
],
"stage": "ingress",
"type": "L3"
}
]
}
}
},
"ACL_TABLE_UNDEFINED_TABLE_TYPE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "LAYER3V4"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
}
}

View File

@ -0,0 +1,141 @@
{
"BREAKOUT_CFG_CORRECT_MODES": {
"sonic-breakout_cfg:sonic-breakout_cfg": {
"sonic-breakout_cfg:BREAKOUT_CFG": {
"BREAKOUT_CFG_LIST": [
{
"brkout_mode": "1x200G[100G,50G,40G,25G,10G,1G]",
"port": "Ethernet0"
},
{
"brkout_mode": "2x100G[50G,40G,25G,10G,1G]",
"port": "Ethernet8"
},
{
"brkout_mode": "4x50G[40G,25G,10G,1G]",
"port": "Ethernet4"
},
{
"brkout_mode": "1x25G[10G]",
"port": "Ethernet12"
},
{
"brkout_mode": "1x100G[50G,40G,25G,10G]",
"port": "Ethernet16"
},
{
"brkout_mode": "2x50G[40G,25G,10G]",
"port": "Ethernet20"
},
{
"brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"port": "Ethernet24"
}
]
}
}
},
"BREAKOUT_CFG_INCORRECT_MODES": {
"sonic-breakout_cfg:sonic-breakout_cfg": {
"sonic-breakout_cfg:BREAKOUT_CFG": {
"BREAKOUT_CFG_LIST": [
{
"brkout_mode": "1x500G[100G,50G,40G,25G,10G,1G]",
"port": "Ethernet0"
},
{
"brkout_mode": "2x300G[50G,40G,25G,1G]",
"port": "Ethernet8"
},
{
"brkout_mode": "5x50G[40G,25G]",
"port": "Ethernet4"
}
]
}
}
},
"CRM_BRK_CFG_FLEX_TABLE": {
"sonic-breakout_cfg:sonic-breakout_cfg": {
"sonic-breakout_cfg:BREAKOUT_CFG": {
"BREAKOUT_CFG_LIST": [
{
"brkout_mode": "1x100G[40G]",
"port": "Ethernet0"
},
{
"brkout_mode": "4x25G[10G]",
"port": "Ethernet8"
},
{
"brkout_mode": "2x25G(2)+1x50G(2)",
"port": "Ethernet4"
},
{
"brkout_mode": "1x400G",
"port": "Ethernet12"
},
{
"brkout_mode": "2x200G",
"port": "Ethernet16"
},
{
"brkout_mode": "4x100G",
"port": "Ethernet20"
},
{
"brkout_mode": "8x50G",
"port": "Ethernet24"
}
]
}
},
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": "85",
"acl_counter_low_threshold": "70",
"acl_counter_threshold_type": "percentage",
"dnat_entry_high_threshold": "85",
"dnat_entry_low_threshold": "70",
"dnat_entry_threshold_type": "percentage",
"ipmc_entry_high_threshold": "85",
"ipmc_entry_low_threshold": "70",
"ipmc_entry_threshold_type": "percentage",
"ipv6_neighbor_high_threshold": "67",
"ipv6_neighbor_low_threshold": "56",
"ipv6_neighbor_threshold_type": "percentage",
"nexthop_group_high_threshold": "67",
"nexthop_group_low_threshold": "56",
"nexthop_group_threshold_type": "percentage",
"polling_interval": "0",
"snat_entry_high_threshold": "85",
"snat_entry_low_threshold": "70",
"snat_entry_threshold_type": "percentage"
}
}
},
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
}
}
}
}
}

View File

@ -0,0 +1,222 @@
{
"CRM_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 90,
"acl_counter_low_threshold": 70,
"acl_counter_threshold_type": "free"
}
}
}
},
"CRM_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 85,
"acl_counter_low_threshold": 25,
"acl_counter_threshold_type": "used"
}
}
}
},
"CRM_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 80,
"acl_counter_low_threshold": 81,
"acl_counter_threshold_type": "PERCENTAGE"
}
}
}
},
"CRM_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 110,
"acl_counter_low_threshold": 85,
"acl_counter_threshold_type": "PERCENTAGE"
}
}
}
},
"CRM_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 90,
"acl_counter_low_threshold": 70,
"acl_counter_threshold_type": "wrong"
}
}
}
},
"DNAT_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 90,
"dnat_entry_low_threshold": 70,
"dnat_entry_threshold_type": "free"
}
}
}
},
"DNAT_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 85,
"dnat_entry_low_threshold": 25,
"dnat_entry_threshold_type": "used"
}
}
}
},
"DNAT_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 80,
"dnat_entry_low_threshold": 81,
"dnat_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"DNAT_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 110,
"dnat_entry_low_threshold": 85,
"dnat_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"DNAT_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 90,
"dnat_entry_low_threshold": 70,
"dnat_entry_threshold_type": "wrong"
}
}
}
},
"IPMC_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 90,
"ipmc_entry_low_threshold": 70,
"ipmc_entry_threshold_type": "free"
}
}
}
},
"IPMC_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 85,
"ipmc_entry_low_threshold": 25,
"ipmc_entry_threshold_type": "used"
}
}
}
},
"IPMC_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 80,
"ipmc_entry_low_threshold": 81,
"ipmc_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"IPMC_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 110,
"ipmc_entry_low_threshold": 85,
"ipmc_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"IPMC_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 90,
"ipmc_entry_low_threshold": 70,
"ipmc_entry_threshold_type": "wrong"
}
}
}
},
"SNAT_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 90,
"snat_entry_low_threshold": 70,
"snat_entry_threshold_type": "free"
}
}
}
},
"SNAT_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 85,
"snat_entry_low_threshold": 25,
"snat_entry_threshold_type": "used"
}
}
}
},
"SNAT_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 80,
"snat_entry_low_threshold": 81,
"snat_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"SNAT_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 110,
"snat_entry_low_threshold": 85,
"snat_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"SNAT_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 90,
"snat_entry_low_threshold": 70,
"snat_entry_threshold_type": "wrong"
}
}
}
}
}

View File

@ -0,0 +1,94 @@
{
"DEVICE_METADATA_DEFAULT_BGP_STATUS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_asn": "65000",
"docker_routing_config_mode": "separated",
"hostname": "DUT-ASW",
"platform": "Stone-DX010"
}
}
}
},
"DEVICE_METADATA_DEFAULT_DOCKER_ROUTING_CONFIG_MODE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_asn": "65001",
"default_bgp_status": "up",
"hostname": "DUT-CSW",
"platform": "Stone-DX010"
}
}
}
},
"DEVICE_METADATA_DEFAULT_PFCWD_STATUS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_asn": "65001",
"hostname": "DUT-CSW",
"platform": "DX010"
}
}
}
},
"DEVICE_METADATA_TYPE_INCORRECT_PATTERN": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_asn": "65002",
"type": "ToRrouter"
}
}
}
},
"DEV_META_DEV_NEIGH_VERSION_TABLE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"localhost": {
"bgp_asn": "64850",
"docker_routing_config_mode": "separated",
"hostname": "asw.dc",
"hwsku": "Stone",
"mac": "00:11:22:33:44:55",
"type": "ToRRouter"
}
}
},
"sonic-device_neighbor:sonic-device_neighbor": {
"sonic-device_neighbor:DEVICE_NEIGHBOR": {
"DEVICE_NEIGHBOR_LIST": [
{
"name": "dccsw03.nw",
"peer_name": "Ethernet116",
"port": "Eth18"
},
{
"name": "dccsw02.nw",
"peer_name": "Ethernet114",
"port": "Eth18"
},
{
"name": "dccsw01.nw",
"peer_name": "Ethernet112",
"port": "Eth18"
},
{
"name": "dccsw04.nw",
"peer_name": "Ethernet118",
"port": "Eth18"
}
]
}
},
"sonic-versions:sonic-versions": {
"sonic-versions:VERSIONS": {
"DATABASE": {
"VERSION": "version_2_10_31"
}
}
}
}
}

View File

@ -0,0 +1,35 @@
{
"FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE": {
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
}
}
}
}
}

View File

@ -0,0 +1,113 @@
{
"INTERFACE_IPPREFIX_PORT_MUST_CONDITION_FALSE": {
"sonic-interface:sonic-interface": {
"sonic-interface:INTERFACE": {
"INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv4",
"ip-prefix": "10.0.0.1/30",
"name": "Ethernet8",
"scope": "global"
}
],
"INTERFACE_LIST": [
{
"name": "Ethernet9"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet8",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth9",
"description": "Ethernet9",
"lanes": "71",
"mtu": 9000,
"name": "Ethernet9",
"speed": 25000
}
]
}
}
},
"INTERFACE_IPPREFIX_PORT_MUST_CONDITION_TRUE": {
"sonic-interface:sonic-interface": {
"sonic-interface:INTERFACE": {
"INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv4",
"ip-prefix": "10.0.0.1/30",
"name": "Ethernet8",
"scope": "global"
}
],
"INTERFACE_LIST": [
{
"name": "Ethernet8"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"fec": "rs",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet8",
"speed": 25000
}
]
}
}
},
"INTERFACE_IP_PREFIX_EMPTY_STRING": {
"sonic-interface:sonic-interface": {
"sonic-interface:INTERFACE": {
"INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv4",
"ip-prefix": "",
"name": "Ethernet8",
"scope": "global"
}
],
"INTERFACE_LIST": [
{
"name": "Ethernet8"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"mtu": 9000,
"name": "Ethernet8",
"speed": 25000
}
]
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"LOOPBACK_IPPREFIX_PORT_MUST_CONDITION_FALSE": {
"sonic-loopback-interface:sonic-loopback-interface": {
"sonic-loopback-interface:LOOPBACK_INTERFACE": {
"LOOPBACK_INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv6",
"ip-prefix": "2a04:5555:66:7777::1/64",
"name": "lo1",
"scope": "global"
}
]
}
}
}
}

View File

@ -0,0 +1,87 @@
{
"PORT_NEG_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"fec": "rc",
"lanes": "65",
"mtu": 9000,
"pfc_asym": "off",
"name": "Ethernet8",
"speed": 25000
}
]
}
}
},
"PORT_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"fec": "rs",
"lanes": "65",
"mtu": 9000,
"pfc_asym": "on",
"name": "Ethernet8",
"speed": 25000
}
]
}
}
},
"PORT_VALID_AUTONEG_TEST_1": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"autoneg": "on"
}
]
}
}
},
"PORT_VALID_AUTONEG_TEST_2": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"autoneg": "off"
}
]
}
}
},
"PORT_INVALID_AUTONEG_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"autoneg": 0
}
]
}
}
}
}

View File

@ -0,0 +1,129 @@
{
"PORT_CHANNEL_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"members": [
"Ethernet0"
],
"min_links": "1",
"mtu": "9100",
"name": "PortChannel0001"
}
]
}
}
},
"PORT_CHANNEL_WRONG_PATTERN": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"mtu": "9100",
"name": "PortChannel11001"
}
]
}
}
},
"PORTCHANNEL_INTERFACE_IP_ADDR_TEST": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"name": "PortChannel0001",
"admin_status": "up"
}
]
},
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_IPPREFIX_LIST": [
{
"name": "PortChannel0001",
"ip_prefix": "1.1.1.1/24"
}
]
}
}
},
"PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"name": "PortChannel0001"
}
]
},
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_IPPREFIX_LIST": [
{
"name": "PortChannel0002",
"ip_prefix": "2.2.2.2/24"
}
]
}
}
},
"PORTCHANNEL_MEMBER_WITH_NON_EXIST_PORTCHANNEL": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL_MEMBER": {
"PORTCHANNEL_MEMBER_LIST": [
{
"name": "PortChannel0002",
"port": "Ethernet0"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"speed": 25000,
"lanes": "65"
}
]
}
}
},
"PORTCHANNEL_MEMBER_WITH_NON_EXIST_PORT": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL_MEMBER": {
"PORTCHANNEL_MEMBER_LIST": [
{
"name": "PortChannel0002",
"port": "Ethernet0"
}
]
},
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"name": "PortChannel0002",
"admin_status": "up"
}
]
}
}
}
}

View File

@ -0,0 +1,20 @@
{
"VERSIONS_WITH_INCORRECT_PATTERN": {
"sonic-versions:sonic-versions": {
"sonic-versions:VERSIONS": {
"DATABASE": {
"VERSION": "version_1_2"
}
}
}
},
"VERSIONS_WITH_INCORRECT_PATTERN2": {
"sonic-versions:sonic-versions": {
"sonic-versions:VERSIONS": {
"DATABASE": {
"VERSION": "version_0_2_77"
}
}
}
}
}

View File

@ -0,0 +1,217 @@
{
"INCORRECT_VLAN_NAME": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"admin_status": "up",
"description": "server_vlan",
"dhcp_servers": [
"10.186.72.56"
],
"mtu": "9100",
"name": "Vlan8090"
}
]
}
}
},
"DHCP_SERVER_INCORRECT_FORMAT": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"admin_status": "up",
"description": "server_vlan",
"dhcp_servers": [
"10.186.72.566"
],
"mtu": "9216",
"name": "Vlan100"
}
]
}
}
},
"TAGGING_MODE_WRONG_VALUE": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"description": "server_vlan",
"name": "Vlan100"
}
]
},
"sonic-vlan:VLAN_MEMBER": {
"VLAN_MEMBER_LIST": [
{
"port": "Ethernet0",
"tagging_mode": "non-tagged",
"name": "Vlan100"
}
]
}
}
},
"VLAN_INTERFACE_IPPREFIX_MUST_CONDITION_FALSE": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"description": "server_vlan",
"name": "Vlan100"
}
]
},
"sonic-vlan:VLAN_INTERFACE": {
"VLAN_INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv6",
"ip-prefix": "2a04:5555:66:7777::1/64",
"scope": "global",
"name": "Vlan100"
}
]
}
}
},
"VLAN_MEMEBER_WITH_NON_EXIST_VLAN": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"description": "server_vlan",
"name": "Vlan100"
},
{
"description": "ipmi_vlan",
"name": "Vlan300"
}
]
},
"sonic-vlan:VLAN_MEMBER": {
"VLAN_MEMBER_LIST": [
{
"port": "Ethernet0",
"tagging_mode": "tagged",
"name": "Vlan200"
}
]
}
}
},
"VLAN_WITH_NON_EXIST_PORT": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
},
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"description": "server_vlan",
"name": "Vlan100"
}
]
},
"sonic-vlan:VLAN_MEMBER": {
"VLAN_MEMBER_LIST": [
{
"port": "Ethernet156",
"tagging_mode": "tagged",
"name": "Vlan100"
}
]
}
}
},
"WRONG_FAMILY_WITH_IP_PREFIX": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"description": "server_vlan",
"name": "Vlan100"
}
]
},
"sonic-vlan:VLAN_INTERFACE": {
"VLAN_INTERFACE_IPPREFIX_LIST": [
{
"family": "IPv4",
"ip-prefix": "2a04:5555:66:7777::1/64",
"scope": "global",
"name": "Vlan100"
}
],
"VLAN_INTERFACE_LIST": [
{
"name": "Vlan100"
}
]
}
}
},
"ALL_VLAN_TEST": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [{
"name": "Vlan1-4094",
"description": "server_vlan",
"dhcp_servers": [
"10.186.72.56"
],
"mtu": "9100",
"admin_status": "up"
}]
}
}
}
}

File diff suppressed because it is too large Load Diff