Skip to content

Commit

Permalink
[build-failure-fix][GCU] Sort referrer paths alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
ghooo authored and qiluo-msft committed Jan 16, 2022
1 parent fa23bfc commit 11eae4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions generic_config_updater/gu_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def _find_leafref_paths(self, path, config):
ref_paths.append(ref_path)
ref_paths_set.add(ref_path)

ref_paths.sort()
return ref_paths

def _get_inner_leaf_xpaths(self, xpath, sy):
Expand Down
18 changes: 9 additions & 9 deletions tests/generic_config_updater/gu_common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,13 @@ def test_find_ref_paths__path_is_table__returns_ref_paths(self):
# Arrange
path = "/PORT"
expected = [
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
"/VLAN_MEMBER/Vlan1000|Ethernet0",
"/ACL_TABLE/DATAACL/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/0",
"/VLAN_MEMBER/Vlan1000|Ethernet4",
"/ACL_TABLE/EVERFLOW/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/1",
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
"/VLAN_MEMBER/Vlan1000|Ethernet0",
"/VLAN_MEMBER/Vlan1000|Ethernet4",
"/VLAN_MEMBER/Vlan1000|Ethernet8"
]

Expand All @@ -659,14 +659,14 @@ def test_find_ref_paths__whole_config_path__returns_all_refs(self):
# Arrange
path = ""
expected = [
"/VLAN_MEMBER/Vlan1000|Ethernet0",
"/VLAN_MEMBER/Vlan1000|Ethernet4",
"/VLAN_MEMBER/Vlan1000|Ethernet8",
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
"/ACL_TABLE/DATAACL/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/0",
"/ACL_TABLE/EVERFLOW/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/0",
"/ACL_TABLE/EVERFLOWV6/ports/1",
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
"/VLAN_MEMBER/Vlan1000|Ethernet0",
"/VLAN_MEMBER/Vlan1000|Ethernet4",
"/VLAN_MEMBER/Vlan1000|Ethernet8",
]

# Act
Expand Down

0 comments on commit 11eae4b

Please sign in to comment.