Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fpfeng committed Feb 14, 2023
1 parent 9ed781d commit 1e65b8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugin2889/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Enum(CaseSensitiveEnum):
def _missing_(cls, value):
if isinstance(value, str):
for member in cls:
if member.name == value or member.value == value.lower():
if member.name == value:
return member


Expand Down Expand Up @@ -299,7 +299,7 @@ def is_pair_topology(self) -> bool:
return self == type(self).PAIRS


class LatencyModeStr(Enum):
class LatencyMode(Enum):
FIRST2LAST = "first_to_last"
LAST2LAST = "last_to_last"
FIRST2FIRST = "first_to_first"
Expand Down
7 changes: 2 additions & 5 deletions plugin2889/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
StreamRateType,
DurationTimeUnit,
TestTopology,
LatencyModeStr,
LatencyMode,
TidAllocationScope,
TrafficDirection,
)
Expand Down Expand Up @@ -469,7 +469,7 @@ def __init__(self, **data: Any):
class GeneralTestConfiguration(BaseModel):
frame_sizes: FrameSizeConfiguration
rate_definition: RateDefinition
latency_mode: LatencyModeStr
latency_mode: LatencyMode
toggle_sync_state: bool
sync_off_duration: int
sync_on_duration: int
Expand Down Expand Up @@ -508,9 +508,6 @@ def identity(self) -> str:
return f"{self.chassis_index}-{self.module_index}-{self.port_index}"





def hex_string_to_binary_string(hex: str) -> "BinaryString":
"""binary string with leading zeros
"""
Expand Down
6 changes: 3 additions & 3 deletions plugin2889/model/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
StreamRateType,
DurationTimeUnit,
TestTopology,
LatencyModeStr,
LatencyMode,
TidAllocationScope,
TrafficDirection,
)
Expand Down Expand Up @@ -448,7 +448,7 @@ def packet_size_list(self) -> Iterable[int]:
packet_size_type = self.packet_size_type
if packet_size_type == PacketSizeType.IETF_DEFAULT:
return DEFAULT_MIXED_PACKET_SIZE
elif packet_size_type == PacketSizeType.CUSTOM:
elif packet_size_type == PacketSizeType.CUSTOM_SIZES:
return list(sorted(self.custom_packet_sizes))
elif packet_size_type == PacketSizeType.MIX:
return [self.mixed_average_packet_size]
Expand All @@ -473,7 +473,7 @@ def __init__(self, **data: Any):
class GeneralTestConfiguration(BaseModel):
frame_sizes: FrameSizeConfiguration
rate_definition: RateDefinition
latency_mode: LatencyModeStr
latency_mode: LatencyMode
toggle_sync_state: bool
sync_off_duration: int
sync_on_duration: int
Expand Down

0 comments on commit 1e65b8e

Please sign in to comment.