@pytest.fixture(scope="module", autouse=True)
def verify_configdb_with_empty_input(duthosts, rand_one_dut_hostname):
"""Fail immediately if empty input test failure
Args:
duthosts: list of DUTs.
rand_one_dut_hostname: Hostname of a random chosen dut
Returns:
None.
"""
duthost = duthosts[rand_one_dut_hostname]
json_patch = []
tmpfile = generate_tmpfile(duthost)
try:
output = apply_patch(duthost, json_data=json_patch, dest_file=tmpfile)
if output['rc'] or "Patch applied successfully" not in output['stdout']:
pytest.fail(
"SETUP FAILURE: ConfigDB fail to validate Yang. rc:{} msg:{}"
.format(output['rc'], output['stdout'])
)
E Failed: SETUP FAILURE: ConfigDB fail to validate Yang. rc:2 msg:Patch Applier: Patch application starting.
E Patch Applier: Patch: []
E Patch Applier: Getting current config db.
E Patch Applier: Simulating the target full config after applying the patch.
E Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
E Patch Applier: Sorting patch updates.
generated xml file: /data/sonic-mgmt/tests/logs/08-11-2023/test_ipv6_generic/tr.xml -
=========================== short test summary info ============================
ERROR generic_config_updater/test_ipv6.py::test_ipv6_suite - Failed: SETUP FA...
========================== 1 error in 435.85 seconds ===========================
Description The following test cases under Generic Config Updater is failing due to "Failed: SETUP FAILURE: ConfigDB fail to validate Yang."
Case List:
Steps to reproduce the issue:
Describe the results you received: GCU cases are resulting in error.
Describe the results you expected: Expecting the case to PASS.
__ ERROR at setup of test_ipv6_suite ___
duthosts = []
rand_one_dut_hostname = 'dev-msn2700-01'
duthost =
duthosts = []
json_patch = []
output = {'stderr_lines': [u'Failed to apply patch', u'Usage: config apply-patch [OPTIO...s.'], u'start': u'2023-06-19 01:12:24.872105', u'msg': u'non-zero return code'}
rand_one_dut_hostname = 'dev-msn2700-01'
tmpfile = u'/tmp/tmp.Y3ByScIdaw'
generic_config_updater/conftest.py:105: Failed