open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
69 stars 7 forks source link

gosnappi: Deserialization of negative value for metrics #135

Closed indraniBh closed 2 years ago

indraniBh commented 2 years ago

When controller sends negative value got following error: "property bytes_tx shall be of type <class 'int'> at <class 'snappi.snappi.PortMetric'> \n got -2135387776 of type <class 'int'> "

gosnappi should deserialize negative value.

ashutshkumr commented 2 years ago

@indraniBh please provide exact steps to reproduce the issue.

ANISH-GOTTAPU commented 2 years ago

@indraniBh : didn't get the use case, why the controller sends negative value for bytes_tx, can you please elaborate

indraniBh commented 2 years ago

@ANISH-GOTTAPU : Currently SetBytesTx(value int32) takes int32. From usstream we are receiving bytes_tx as int64 and then typecast it to int32(). For lower value it works fine. For higher values of bytes_tx like 2151114560 > range of int32, it takes garbage value (negative value).

ANISH-GOTTAPU commented 2 years ago

closing the issue as it is related to https://github.com/open-traffic-generator/models/issues/188 , re-open if issue exists after the models update