diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 3 | ||||
-rwxr-xr-x | scripts/master_daemon.py | 10 | ||||
-rw-r--r-- | scripts/stl/udp_1pkt_src_ip_split.py | 14 |
3 files changed, 17 insertions, 10 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 153985ae..7c8a5fbf 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -511,8 +511,7 @@ class STLClient(object): self.connected = False # API classes - self.api_vers = [ {'type': 'core', 'major': 1, 'minor':2 } - ] + self.api_vers = [ {'type': 'core', 'major': 1, 'minor': 3 } ] self.api_h = {'core': None} # logger diff --git a/scripts/master_daemon.py b/scripts/master_daemon.py index a44f55a8..3a9d7ffe 100755 --- a/scripts/master_daemon.py +++ b/scripts/master_daemon.py @@ -221,9 +221,13 @@ if args.action != 'show': raise Exception('%s does not have function %s' % (daemon.name, args.action)) try: func() - except Exception as e: - print(termstyle.red(e)) - sys.exit(1) + except: + try: # give it another try + sleep(1) + func() + except Exception as e: + print(termstyle.red(e)) + sys.exit(1) passive = {'start': 'started', 'restart': 'restarted', 'stop': 'stopped', 'show': 'running'} diff --git a/scripts/stl/udp_1pkt_src_ip_split.py b/scripts/stl/udp_1pkt_src_ip_split.py index 48e02433..99e7496c 100644 --- a/scripts/stl/udp_1pkt_src_ip_split.py +++ b/scripts/stl/udp_1pkt_src_ip_split.py @@ -8,11 +8,15 @@ class STLS1(object): def __init__ (self): self.fsize =64; - def create_stream (self): + def create_stream (self, direction, cache_size): # Create base packet and pad it to size size = self.fsize - 4; # HW will add 4 bytes ethernet FCS + src_ip = '16.0.0.1' + dst_ip = '48.0.0.1' + if direction: + src_ip, dst_ip = dst_ip, src_ip - base_pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025) + base_pkt = Ether()/IP(src=src_ip,dst=dst_ip)/UDP(dport=12,sport=1025) pad = max(0, size - len(base_pkt)) * 'x' @@ -22,7 +26,7 @@ class STLS1(object): STLVmFixIpv4(offset = "IP") # fix checksum ] ,split_by_field = "ip_src" # split to cores base on the tuple generator - ,cache_size =255 # the cache size + ,cache_size = cache_size # the cache size ); pkt = STLPktBuilder(pkt = base_pkt/pad, @@ -33,9 +37,9 @@ class STLS1(object): return stream - def get_streams (self, direction = 0, **kwargs): + def get_streams (self, direction = 0, cache_size = 255, **kwargs): # create 1 stream - return [ self.create_stream() ] + return [ self.create_stream(direction, cache_size) ] # dynamic load - used for trex console or simulator |