Skip to content

Commit

Permalink
Update sonic-config-engine tests for Bookworm
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
saiarcot895 authored and pull[bot] committed Jul 29, 2024
1 parent 53b1aec commit bbd77fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/sonic-config-engine/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
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',
]
Expand Down
5 changes: 2 additions & 3 deletions src/sonic-config-engine/tests/test_cfggen_from_yang.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ def test_portchannel_table(self):
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'}})

Expand Down Expand Up @@ -194,7 +192,8 @@ def test_acl_rule(self):
"EVERFLOW|Rule2": {
"DST_IP": "192.169.10.1/32",
"SRC_IP": "10.10.1.1/16",
"IP_TYPE": "IPV4"
"IP_TYPE": "IPV4",
"PRIORITY": "101"
}
})

Expand Down
11 changes: 2 additions & 9 deletions src/sonic-config-engine/tests/test_yang_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,13 @@
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"members": [
"Ethernet0",
"Ethernet4"
],
"min_links": "1",
"mtu": "9100",
"lacp_key": "auto",
"name": "PortChannel1001"
},
{
"admin_status": "up",
"members": [
"Ethernet16",
"Ethernet20"
],
"min_links": "1",
"mtu": "9100",
"lacp_key": "auto",
Expand Down Expand Up @@ -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
}
]
}
Expand Down

0 comments on commit bbd77fc

Please sign in to comment.