From 0a77a09d1ae345e4cf5033b95e70fa454c28dd6f Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Mon, 1 Jun 2020 18:36:25 +0200 Subject: [PATCH] [meta] Fix tests to be backward compatible (#619) --- meta/saiserialize.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/meta/saiserialize.cpp b/meta/saiserialize.cpp index 87d25c3a84bc..b8e6e9a2bb53 100644 --- a/meta/saiserialize.cpp +++ b/meta/saiserialize.cpp @@ -1934,6 +1934,13 @@ void sai_deserialize_enum( } } + // for backward compatibility from SAI v1.6 + if (s == "SAI_NEXT_HOP_GROUP_TYPE_ECMP") + { + value = SAI_NEXT_HOP_GROUP_TYPE_ECMP; + return; + } + SWSS_LOG_WARN("enum %s not found in enum %s", s.c_str(), meta->name); sai_deserialize_number(s, value); @@ -2090,7 +2097,16 @@ void sai_deserialize_qos_map_params( params.prio = j["prio"]; params.pg = j["pg"]; params.queue_index = j["qidx"]; - params.mpls_exp = j["mpls_exp"]; + + if (j.find("mpls_exp") == j.end()) + { + // for backward compatibility + params.mpls_exp = 0; + } + else + { + params.mpls_exp = j["mpls_exp"]; + } sai_deserialize_packet_color(j["color"], params.color); }