From 3183e88e8ca8a0c35f91103aad3473d0b948df1c Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 4 Oct 2022 17:05:53 -0700 Subject: [PATCH] Remove event yang models from test count (#36) --- .../tests/libyang-python-tests/test_sonic_yang.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py b/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py index a13d4c02e9a0..86b27ef174e5 100644 --- a/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py +++ b/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py @@ -292,11 +292,13 @@ def test_validate_yang_models(self, sonic_yang_data): ''' test_file = sonic_yang_data['test_file'] syc = sonic_yang_data['syc'] - # Currently only 3 YANG files are not directly related to config + # Currently only 3 YANG files are not directly related to config, along with event YANG models # which are: sonic-extension.yang, sonic-types.yang and sonic-bgp-common.yang. Hard coding # it right now. + # event YANG models do not map directly to config_db and are included to NON_CONFIG_YANG_FILES at run time # If any more such helper yang files are added, we need to update here. - NON_CONFIG_YANG_FILES = 3 + EVENT_YANG_FILES = sum(1 for yang_model in syc.yangFiles if 'sonic-events' in yang_model) + NON_CONFIG_YANG_FILES = 3 + EVENT_YANG_FILES # read config jIn = self.readIjsonInput(test_file, 'SAMPLE_CONFIG_DB_JSON') jIn = json.loads(jIn)