Feature Enhancement:
1] Modifying output in case of module
test_command_version:
- command: show interfaces terse
- iterate:
xpath: physical-interface
id: ['./name', 'admin-status']
tests:
- no-diff: oper-status
err: "Test Failed!! oper-status got changed, before it was <{{pre['oper-status']}}>, now it is <{{post['oper-status']}}> with name <{{id_0}}> and admin status <{{post['admin-status']}}>"
info: "Test Passed! oper-status is same with value, before it is <{{pre['oper-status']}}> now it is <{{post['oper-status']}}> with admin status <{{post['admin-status']}}> "
Below is the output of “no-diff” test operation.
Tested on adora
Final result: Passed
Total passed: 1
Total failed: 0
{'show interfaces terse': [{'count': {'fail': 0, 'pass': 59},
'failed': [],
'node_name': 'oper-status',
'passed': [[{'id': {'./name': 'tap',
'admin-status': 'up'},
'post': {'admin-status': 'up',
'oper-status': ['up']},
'post_node_value': ['up'],
'pre': {'oper-status': ['up']},
'pre_node_value': ['up']}],
[{'id': {'./name': 'pimd',
'admin-status': 'up'},
'post': {'admin-status': 'up',
'oper-status': ['up']},
'post_node_value': ['up'],
'pre': {'oper-status': ['up']},
'pre_node_value': ['up']}]],
'post_xml': <lxml.etree._ElementTree object at 0x10d958f80>,
'pre_xml': <lxml.etree._ElementTree object at 0x10d958ef0>,
'result': True,
'testoperation': 'no-diff',
'xpath': 'physical-interface'}]}
2] Added verbosity:
-v, --verbosity Set verbosity
-v: Debug level messages
-vv: Info level messages
-vvv: Warning level messages
-vvvv: Error level messages
-vvvvv: Critical level messages
Bug Fixes:
1] Making error messages more precise for better understanding.