From e078a543fec4619005c7a330e6c23750e573068b Mon Sep 17 00:00:00 2001 From: sai chintalapudi Date: Wed, 28 Nov 2018 13:30:14 -0800 Subject: [PATCH] Fix for route map src proto sorting --- lib/cisco_node_utils/route_map.rb | 2 +- tests/test_route_map.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/cisco_node_utils/route_map.rb b/lib/cisco_node_utils/route_map.rb index 977720f2..114a497d 100644 --- a/lib/cisco_node_utils/route_map.rb +++ b/lib/cisco_node_utils/route_map.rb @@ -309,7 +309,7 @@ def default_match_tag # match source-protocol tcp udp def match_src_proto str = config_get('route_map', 'match_src_proto', @get_args) - str.empty? ? default_match_src_proto : str.split + str.empty? ? default_match_src_proto : str.split.sort end def match_src_proto=(list) diff --git a/tests/test_route_map.rb b/tests/test_route_map.rb index 708ac191..c280b749 100644 --- a/tests/test_route_map.rb +++ b/tests/test_route_map.rb @@ -152,11 +152,9 @@ def test_match_tag def test_match_src_proto rm = create_route_map assert_equal(rm.default_match_src_proto, rm.match_src_proto) - array = %w(tcp udp igmp) + array = %w(tcp udp igmp).sort rm.match_src_proto = array - # Protocol order not maintained in running config starting Greensboro. - # Sorting arrays to check equality. - assert_equal(array.sort, rm.match_src_proto.sort) + assert_equal(array, rm.match_src_proto) rm.match_src_proto = rm.default_match_src_proto assert_equal(rm.default_match_src_proto, rm.match_src_proto) end