Skip to content

Commit 0a77a09

Browse files
authored
[meta] Fix tests to be backward compatible (sonic-net#619)
1 parent ebdf4ff commit 0a77a09

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

meta/saiserialize.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,13 @@ void sai_deserialize_enum(
19341934
}
19351935
}
19361936

1937+
// for backward compatibility from SAI v1.6
1938+
if (s == "SAI_NEXT_HOP_GROUP_TYPE_ECMP")
1939+
{
1940+
value = SAI_NEXT_HOP_GROUP_TYPE_ECMP;
1941+
return;
1942+
}
1943+
19371944
SWSS_LOG_WARN("enum %s not found in enum %s", s.c_str(), meta->name);
19381945

19391946
sai_deserialize_number(s, value);
@@ -2090,7 +2097,16 @@ void sai_deserialize_qos_map_params(
20902097
params.prio = j["prio"];
20912098
params.pg = j["pg"];
20922099
params.queue_index = j["qidx"];
2093-
params.mpls_exp = j["mpls_exp"];
2100+
2101+
if (j.find("mpls_exp") == j.end())
2102+
{
2103+
// for backward compatibility
2104+
params.mpls_exp = 0;
2105+
}
2106+
else
2107+
{
2108+
params.mpls_exp = j["mpls_exp"];
2109+
}
20942110

20952111
sai_deserialize_packet_color(j["color"], params.color);
20962112
}

0 commit comments

Comments
 (0)