From c112e16ff0405ab65472d681fa52420940c5f02e Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 6 Sep 2023 12:15:34 -0700 Subject: [PATCH] Update sonic-config-engine tests for Bookworm Update test_cfggen_from_yang.py and test_yang_data.json to the current config_db format, and allow tests for sonic-config-engine to run for Bookworm. Also update pyangbind to 0.8.2 for Bookworm to fix an issue with some classes being moved into a different package. Signed-off-by: Saikrishna Arcot --- src/sonic-config-engine/setup.py | 4 ++-- .../tests/test_cfggen_from_yang.py | 5 ++--- src/sonic-config-engine/tests/test_yang_data.json | 11 ++--------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/sonic-config-engine/setup.py b/src/sonic-config-engine/setup.py index 8340af815a..ac785aa107 100644 --- a/src/sonic-config-engine/setup.py +++ b/src/sonic-config-engine/setup.py @@ -20,10 +20,10 @@ dependencies = [ if sys.version_info.major == 3: # Python 3-only dependencies dependencies += [ - # pyangbind v0.8.1 pull down enum43 which causes 're' package to malfunction. + # pyangbind v0.8.2 pull down enum43 which causes 're' package to malfunction. # Python3 has enum module and so pyangbind should be installed outside # dependencies section of setuptools followed by uninstall of enum43 - # 'pyangbind==0.8.1', + # 'pyangbind==0.8.2', 'Jinja2>=2.10', 'pyyaml==6.0.1', ] diff --git a/src/sonic-config-engine/tests/test_cfggen_from_yang.py b/src/sonic-config-engine/tests/test_cfggen_from_yang.py index 5886b2cc88..48b970df82 100644 --- a/src/sonic-config-engine/tests/test_cfggen_from_yang.py +++ b/src/sonic-config-engine/tests/test_cfggen_from_yang.py @@ -104,12 +104,10 @@ class TestCfgGen(object): assert(output == \ {'PortChannel1001': {'admin_status': 'up', 'lacp_key': 'auto', - 'members': ['Ethernet0', 'Ethernet4'], 'min_links': '1', 'mtu': '9100'}, 'PortChannel1002': {'admin_status': 'up', 'lacp_key': 'auto', - 'members': ['Ethernet16', 'Ethernet20'], 'min_links': '1', 'mtu': '9100'}}) @@ -194,7 +192,8 @@ class TestCfgGen(object): "EVERFLOW|Rule2": { "DST_IP": "192.169.10.1/32", "SRC_IP": "10.10.1.1/16", - "IP_TYPE": "IPV4" + "IP_TYPE": "IPV4", + "PRIORITY": "101" } }) diff --git a/src/sonic-config-engine/tests/test_yang_data.json b/src/sonic-config-engine/tests/test_yang_data.json index 41aab043d4..8126e7bc26 100644 --- a/src/sonic-config-engine/tests/test_yang_data.json +++ b/src/sonic-config-engine/tests/test_yang_data.json @@ -98,10 +98,6 @@ "PORTCHANNEL_LIST": [ { "admin_status": "up", - "members": [ - "Ethernet0", - "Ethernet4" - ], "min_links": "1", "mtu": "9100", "lacp_key": "auto", @@ -109,10 +105,6 @@ }, { "admin_status": "up", - "members": [ - "Ethernet16", - "Ethernet20" - ], "min_links": "1", "mtu": "9100", "lacp_key": "auto", @@ -300,7 +292,8 @@ "DST_IP": "192.169.10.1/32", "SRC_IP": "10.10.1.1/16", "IP_TYPE": "IPV4", - "RULE_NAME": "Rule2" + "RULE_NAME": "Rule2", + "PRIORITY": 101 } ] }