From 501fb3b44f14e9c0d40a63bd8b47200b01e50be9 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Thu, 14 Apr 2016 17:23:04 +0300 Subject: regression: python3 support --- .../stl/trex_stl_lib/trex_stl_hltapi.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py index 9518852f..45f3dd45 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py @@ -172,23 +172,12 @@ import sys import os import socket import copy -from collections import defaultdict, OrderedDict +from collections import defaultdict from .api import * from .trex_stl_types import * from .utils.common import get_number -class LRU_cache(OrderedDict): - def __init__(self, maxlen = 20, *args, **kwargs): - OrderedDict.__init__(self, *args, **kwargs) - self.maxlen = maxlen - - def __setitem__(self, *args, **kwargs): - OrderedDict.__setitem__(self, *args, **kwargs) - if len(self) > self.maxlen: - self.popitem(last = False) - - class HLT_ERR(dict): def __init__(self, log = 'Unknown error', **kwargs): dict.__init__(self, {'status': 0}) @@ -1078,7 +1067,7 @@ def generate_packet(**user_kwargs): if ip_tos < 0 or ip_tos > 255: raise STLError('TOS %s is not in range 0-255' % ip_tos) l3_layer = IP(tos = ip_tos, - len = kwargs['l3_length'], + #len = kwargs['l3_length'], don't let user create corrupt packets id = kwargs['ip_id'], frag = kwargs['ip_fragment_offset'], ttl = kwargs['ip_ttl'], -- cgit 1.2.3-korg