Skip to content

Commit c6d0814

Browse files
committed
Fixing test issues
1 parent c430e26 commit c6d0814

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

src/sonic-yang-mgmt/tests/test_cfghelp.py

+31-27
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,35 @@
2626
AUTO_TECHSUPPORT
2727
Description: AUTO_TECHSUPPORT part of config_db.json
2828
29-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
30-
| Field | Description | Mandatory | Default | Reference |
31-
+=======================+====================================================+=============+===========+=============+
32-
| state | Knob to make techsupport invocation event-driven | | | |
33-
| | based on core-dump generation | | | |
34-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
35-
| rate_limit_interval | Minimum time in seconds between two successive | | | |
36-
| | techsupport invocations. Configure 0 to explicitly | | | |
37-
| | disable | | | |
38-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
39-
| max_techsupport_limit | Max Limit in percentage for the cummulative size | | | |
40-
| | of ts dumps. No cleanup is performed if the value | | | |
41-
| | isn't configured or is 0.0 | | | |
42-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
43-
| max_core_limit | Max Limit in percentage for the cummulative size | | | |
44-
| | of core dumps. No cleanup is performed if the | | | |
45-
| | value isn't congiured or is 0.0 | | | |
46-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
47-
| since | Only collect the logs & core-dumps generated since | | | |
48-
| | the time provided. A default value of '2 days ago' | | | |
49-
| | is used if this value is not set explicitly or a | | | |
50-
| | non-valid string is provided | | | |
51-
+-----------------------+----------------------------------------------------+-------------+-----------+-------------+
29+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
30+
| Field | Description | Mandatory | Default | Reference |
31+
+=========================+====================================================+=============+===========+=============+
32+
| state | Knob to make techsupport invocation event-driven | | | |
33+
| | based on core-dump generation | | | |
34+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
35+
| rate_limit_interval | Minimum time in seconds between two successive | | | |
36+
| | techsupport invocations. Configure 0 to explicitly | | | |
37+
| | disable | | | |
38+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
39+
| max_techsupport_limit | Max Limit in percentage for the cummulative size | | | |
40+
| | of ts dumps. No cleanup is performed if the value | | | |
41+
| | isn't configured or is 0.0 | | | |
42+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
43+
| max_core_limit | Max Limit in percentage for the cummulative size | | | |
44+
| | of core dumps. No cleanup is performed if the | | | |
45+
| | value isn't congiured or is 0.0 | | | |
46+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
47+
| available_mem_threshold | Memory threshold; 0 to disable techsupport | | 10.0 | |
48+
| | invocation on memory usage threshold crossing | | | |
49+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
50+
| min_available_mem | Minimum Free memory (in MB) that should be | | 200 | |
51+
| | available for the techsupport execution to start | | | |
52+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
53+
| since | Only collect the logs & core-dumps generated since | | | |
54+
| | the time provided. A default value of '2 days ago' | | | |
55+
| | is used if this value is not set explicitly or a | | | |
56+
| | non-valid string is provided | | | |
57+
+-------------------------+----------------------------------------------------+-------------+-----------+-------------+
5258
5359
"""
5460

@@ -117,7 +123,7 @@ class TestCfgHelp(TestCase):
117123

118124
def setUp(self):
119125
self.test_dir = os.path.dirname(os.path.realpath(__file__))
120-
self.script_file = 'python ' + os.path.join(self.test_dir, '..', 'sonic-cfg-help')
126+
self.script_file = os.path.join(self.test_dir, '..', 'sonic-cfg-help')
121127

122128
def run_script(self, argument):
123129
print('\n Running sonic-cfg-help ' + argument)
@@ -150,17 +156,15 @@ def test_single_field(self):
150156
def test_leaf_list(self):
151157
argument = '-t PORTCHANNEL -f members'
152158
output = self.run_script(argument)
153-
print(output)
154159
self.assertEqual(output, portchannel_table_field_output)
155160

156161
def test_leaf_list_map(self):
157162
argument = '-t DSCP_TO_TC_MAP'
158163
output = self.run_script(argument)
159-
print(output)
164+
self.maxDiff = None
160165
self.assertEqual(output, dscp_to_tc_table_field_output)
161166

162167
def test_when_condition(self):
163168
argument = '-t ACL_RULE -f ICMP_TYPE'
164169
output = self.run_script(argument)
165-
print(output)
166170
self.assertEqual(output, acl_rule_table_field_output)

0 commit comments

Comments
 (0)