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 <sarcot@microsoft.com>
This commit is contained in:
Saikrishna Arcot 2023-09-06 12:15:34 -07:00 committed by Ying Xie
parent c6963406cf
commit c112e16ff0
3 changed files with 6 additions and 14 deletions

View File

@ -20,10 +20,10 @@ dependencies = [
if sys.version_info.major == 3: if sys.version_info.major == 3:
# Python 3-only dependencies # Python 3-only dependencies
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 # Python3 has enum module and so pyangbind should be installed outside
# dependencies section of setuptools followed by uninstall of enum43 # dependencies section of setuptools followed by uninstall of enum43
# 'pyangbind==0.8.1', # 'pyangbind==0.8.2',
'Jinja2>=2.10', 'Jinja2>=2.10',
'pyyaml==6.0.1', 'pyyaml==6.0.1',
] ]

View File

@ -104,12 +104,10 @@ class TestCfgGen(object):
assert(output == \ assert(output == \
{'PortChannel1001': {'admin_status': 'up', {'PortChannel1001': {'admin_status': 'up',
'lacp_key': 'auto', 'lacp_key': 'auto',
'members': ['Ethernet0', 'Ethernet4'],
'min_links': '1', 'min_links': '1',
'mtu': '9100'}, 'mtu': '9100'},
'PortChannel1002': {'admin_status': 'up', 'PortChannel1002': {'admin_status': 'up',
'lacp_key': 'auto', 'lacp_key': 'auto',
'members': ['Ethernet16', 'Ethernet20'],
'min_links': '1', 'min_links': '1',
'mtu': '9100'}}) 'mtu': '9100'}})
@ -194,7 +192,8 @@ class TestCfgGen(object):
"EVERFLOW|Rule2": { "EVERFLOW|Rule2": {
"DST_IP": "192.169.10.1/32", "DST_IP": "192.169.10.1/32",
"SRC_IP": "10.10.1.1/16", "SRC_IP": "10.10.1.1/16",
"IP_TYPE": "IPV4" "IP_TYPE": "IPV4",
"PRIORITY": "101"
} }
}) })

View File

@ -98,10 +98,6 @@
"PORTCHANNEL_LIST": [ "PORTCHANNEL_LIST": [
{ {
"admin_status": "up", "admin_status": "up",
"members": [
"Ethernet0",
"Ethernet4"
],
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto", "lacp_key": "auto",
@ -109,10 +105,6 @@
}, },
{ {
"admin_status": "up", "admin_status": "up",
"members": [
"Ethernet16",
"Ethernet20"
],
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto", "lacp_key": "auto",
@ -300,7 +292,8 @@
"DST_IP": "192.169.10.1/32", "DST_IP": "192.169.10.1/32",
"SRC_IP": "10.10.1.1/16", "SRC_IP": "10.10.1.1/16",
"IP_TYPE": "IPV4", "IP_TYPE": "IPV4",
"RULE_NAME": "Rule2" "RULE_NAME": "Rule2",
"PRIORITY": 101
} }
] ]
} }