This commit is contained in:
parent
0ea0855213
commit
2b54221976
@ -54,7 +54,14 @@ class SonicCfgDescriber:
|
|||||||
self.print_field_desc(table['list'], field)
|
self.print_field_desc(table['list'], field)
|
||||||
print()
|
print()
|
||||||
elif table.get('container') is not None:
|
elif table.get('container') is not None:
|
||||||
|
if isinstance(table['container'], dict):
|
||||||
|
print("key - " + table['container'].get('@name'))
|
||||||
self.print_field_desc(table.get('container'), field)
|
self.print_field_desc(table.get('container'), field)
|
||||||
|
elif isinstance(table['container'], list):
|
||||||
|
for c in table['container']:
|
||||||
|
print("key - " + c.get('@name'))
|
||||||
|
self.print_field_desc(c, field)
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
def get_referenced_table_field(self, ref):
|
def get_referenced_table_field(self, ref):
|
||||||
|
@ -25,6 +25,7 @@ techsupport_table_output="""\
|
|||||||
AUTO_TECHSUPPORT
|
AUTO_TECHSUPPORT
|
||||||
Description: AUTO_TECHSUPPORT part of config_db.json
|
Description: AUTO_TECHSUPPORT part of config_db.json
|
||||||
|
|
||||||
|
key - GLOBAL
|
||||||
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
|
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
|
||||||
| Field | Description | Mandatory | Default | Reference |
|
| Field | Description | Mandatory | Default | Reference |
|
||||||
+=========================+====================================================+=============+===========+=============+
|
+=========================+====================================================+=============+===========+=============+
|
||||||
@ -62,6 +63,7 @@ techsupport_table_field_output="""\
|
|||||||
AUTO_TECHSUPPORT
|
AUTO_TECHSUPPORT
|
||||||
Description: AUTO_TECHSUPPORT part of config_db.json
|
Description: AUTO_TECHSUPPORT part of config_db.json
|
||||||
|
|
||||||
|
key - GLOBAL
|
||||||
+---------+--------------------------------------------------+-------------+-----------+-------------+
|
+---------+--------------------------------------------------+-------------+-----------+-------------+
|
||||||
| Field | Description | Mandatory | Default | Reference |
|
| Field | Description | Mandatory | Default | Reference |
|
||||||
+=========+==================================================+=============+===========+=============+
|
+=========+==================================================+=============+===========+=============+
|
||||||
@ -118,6 +120,25 @@ key - ACL_TABLE_NAME:RULE_NAME
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
snmp_table_output="""\
|
||||||
|
|
||||||
|
SNMP
|
||||||
|
|
||||||
|
key - CONTACT
|
||||||
|
+---------+----------------------+-------------+-----------+-------------+
|
||||||
|
| Field | Description | Mandatory | Default | Reference |
|
||||||
|
+=========+======================+=============+===========+=============+
|
||||||
|
| Contact | SNMP System Contact. | | | |
|
||||||
|
+---------+----------------------+-------------+-----------+-------------+
|
||||||
|
key - LOCATION
|
||||||
|
+----------+-----------------------+-------------+-----------+-------------+
|
||||||
|
| Field | Description | Mandatory | Default | Reference |
|
||||||
|
+==========+=======================+=============+===========+=============+
|
||||||
|
| Location | SNMP System Location. | | | |
|
||||||
|
+----------+-----------------------+-------------+-----------+-------------+
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
class TestCfgHelp(TestCase):
|
class TestCfgHelp(TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -167,3 +188,8 @@ class TestCfgHelp(TestCase):
|
|||||||
argument = ['-t', 'ACL_RULE', '-f', 'ICMP_TYPE']
|
argument = ['-t', 'ACL_RULE', '-f', 'ICMP_TYPE']
|
||||||
output = self.run_script(argument)
|
output = self.run_script(argument)
|
||||||
self.assertEqual(output, acl_rule_table_field_output)
|
self.assertEqual(output, acl_rule_table_field_output)
|
||||||
|
|
||||||
|
def test_nested_container(self):
|
||||||
|
argument = ['-t', 'SNMP']
|
||||||
|
output = self.run_script(argument)
|
||||||
|
self.assertEqual(output, snmp_table_output)
|
||||||
|
Reference in New Issue
Block a user