[sonic-cfggen]: Fix broken UT (#10863)

Why I did it
UT for sonic-config-engine is broken.

How I did it
Remove yang validation.

How to verify it
Run UT for sonic-config-engine.

Signed-off-by: Gang Lv ganglv@microsoft.com
This commit is contained in:
ganglv 2022-05-18 16:44:50 +08:00 committed by GitHub
parent 9eadb98341
commit f58fec5d95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 9 deletions

View File

@ -14,7 +14,6 @@ BACKEND_LEAF_ROUTER = 'BackEndLeafRouter'
class TestCfgGen(TestCase):
def setUp(self):
self.yang = utils.YangWrapper()
self.test_dir = os.path.dirname(os.path.realpath(__file__))
self.script_file = utils.PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen')
self.sample_graph = os.path.join(self.test_dir, 'sample_graph.xml')
@ -51,8 +50,6 @@ class TestCfgGen(TestCase):
def run_script(self, argument, check_stderr=False, verbose=False):
print('\n Running sonic-cfggen ' + argument)
self.assertTrue(self.yang.validate(argument))
if check_stderr:
output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True)
else:

View File

@ -13,7 +13,6 @@ BACKEND_TOR_ROUTER = 'BackEndToRRouter'
class TestCfgGenCaseInsensitive(TestCase):
def setUp(self):
self.yang = utils.YangWrapper()
self.test_dir = os.path.dirname(os.path.realpath(__file__))
self.script_file = utils.PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen')
self.sample_graph = os.path.join(self.test_dir, 'simple-sample-graph-case.xml')
@ -24,8 +23,6 @@ class TestCfgGenCaseInsensitive(TestCase):
def run_script(self, argument, check_stderr=False):
print('\n Running sonic-cfggen ' + argument)
self.assertTrue(self.yang.validate(argument))
if check_stderr:
output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True)
else:

View File

@ -20,7 +20,6 @@ DEVICE_TYPE = 'LeafRouter'
class TestMultiNpuCfgGen(TestCase):
def setUp(self):
self.yang = utils.YangWrapper()
self.test_dir = os.path.dirname(os.path.realpath(__file__))
self.test_data_dir = os.path.join(self.test_dir, 'multi_npu_data')
self.script_file = utils.PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen')
@ -35,8 +34,6 @@ class TestMultiNpuCfgGen(TestCase):
def run_script(self, argument, check_stderr=False):
print('\n Running sonic-cfggen ' + argument)
self.assertTrue(self.yang.validate(argument))
if check_stderr:
output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True)
else: