FIX: direction for profile
authorimarom <[email protected]>
Wed, 16 Mar 2016 09:30:40 +0000 (11:30 +0200)
committerimarom <[email protected]>
Wed, 16 Mar 2016 09:31:20 +0000 (11:31 +0200)
67 files changed:
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
scripts/stl/burst_3st_1000pkt.py
scripts/stl/burst_3st_600pkt.py
scripts/stl/burst_3st_loop_x_times.py
scripts/stl/burst_split.py
scripts/stl/flow_stats.py
scripts/stl/hlt/hlt_4vlans.py
scripts/stl/hlt/hlt_david1.py
scripts/stl/hlt/hlt_david2.py
scripts/stl/hlt/hlt_david3.py
scripts/stl/hlt/hlt_david4.py
scripts/stl/hlt/hlt_framesize_vm.py
scripts/stl/hlt/hlt_imix_4rates.py
scripts/stl/hlt/hlt_imix_default.py
scripts/stl/hlt/hlt_ip_ranges.py
scripts/stl/hlt/hlt_ipv6_default.py
scripts/stl/hlt/hlt_ipv6_ranges.py
scripts/stl/hlt/hlt_l3_length_vm.py
scripts/stl/hlt/hlt_mac_ranges.py
scripts/stl/hlt/hlt_tcp_ranges.py
scripts/stl/hlt/hlt_udp_inc_dec_len_9k.py
scripts/stl/hlt/hlt_udp_ports.py
scripts/stl/hlt/hlt_udp_random_ports.py
scripts/stl/hlt/hlt_vlan_default.py
scripts/stl/hlt/hlt_vlans_vm.py
scripts/stl/hlt/hlt_wentong1.py
scripts/stl/hlt/hlt_wentong2.py
scripts/stl/imix.py
scripts/stl/multi_burst_2st_1000pkt.py
scripts/stl/pcap.py
scripts/stl/pcap_with_vm.py
scripts/stl/simple_3st.py
scripts/stl/syn_attack.py
scripts/stl/udp_1pkt.py
scripts/stl/udp_1pkt_1mac.py
scripts/stl/udp_1pkt_1mac_override.py
scripts/stl/udp_1pkt_1mac_step.py
scripts/stl/udp_1pkt_dns.py
scripts/stl/udp_1pkt_ipv6_in_ipv4.py
scripts/stl/udp_1pkt_mac.py
scripts/stl/udp_1pkt_mac_mask1.py
scripts/stl/udp_1pkt_mac_mask2.py
scripts/stl/udp_1pkt_mac_mask3.py
scripts/stl/udp_1pkt_mac_mask5.py
scripts/stl/udp_1pkt_mac_step.py
scripts/stl/udp_1pkt_mpls.py
scripts/stl/udp_1pkt_mpls_vm.py
scripts/stl/udp_1pkt_pcap.py
scripts/stl/udp_1pkt_pcap_relative_path.py
scripts/stl/udp_1pkt_range_clients.py
scripts/stl/udp_1pkt_range_clients_split.py
scripts/stl/udp_1pkt_range_clients_split_garp.py
scripts/stl/udp_1pkt_simple.py
scripts/stl/udp_1pkt_simple_bdir.py
scripts/stl/udp_1pkt_simple_mac_dst.py
scripts/stl/udp_1pkt_simple_mac_dst_src.py
scripts/stl/udp_1pkt_simple_mac_src.py
scripts/stl/udp_1pkt_simple_test.py
scripts/stl/udp_1pkt_simple_test2.py
scripts/stl/udp_1pkt_tuple_gen.py
scripts/stl/udp_1pkt_tuple_gen_split.py
scripts/stl/udp_1pkt_vxlan.py
scripts/stl/udp_3pkt_pcap.py
scripts/stl/udp_inc_len_9k.py
scripts/stl/udp_rand_len_9k.py

index f7e63cc..6202e12 100644 (file)
@@ -1956,15 +1956,16 @@ class STLClient(object):
 
         # pack the profile
         try:
-            profile = STLProfile.load(opts.file[0])
+            for port in opts.ports:
+                profile = STLProfile.load(opts.file[0], direction = (port % 2), port = port)
+                self.add_streams(profile.get_streams(), ports = port)
+
         except STLError as e:
             self.logger.log(format_text("\nError while loading profile '{0}'\n".format(opts.file[0]), 'bold'))
             self.logger.log(e.brief() + "\n")
             return
 
 
-        self.add_streams(profile.get_streams(), ports = opts.ports)
-
         if opts.dry:
             self.validate(opts.ports, opts.mult, opts.duration, opts.total)
         else:
index 614d8b7..42c37e6 100644 (file)
@@ -141,7 +141,7 @@ class STLSim(object):
         # handle YAMLs
         for input_file in input_files:
             try:
-                profile = STLProfile.load(input_file)
+                profile = STLProfile.load(input_file, direction = (self.port_id % 2), port = self.port_id)
             except STLError as e:
                 s = format_text("\nError while loading profile '{0}'\n".format(input_file), 'bold')
                 s += "\n" + e.brief()
@@ -360,6 +360,13 @@ def setParserOptions():
                         default = None,
                         type = int)
 
+    parser.add_argument("-i", "--port",
+                        help = "Simulate a specific port ID [default is 0]",
+                        dest = "port_id",
+                        default = 0,
+                        type = int)
+
+
     parser.add_argument("-r", "--release",
                         help = "runs on release image instead of debug [default is False]",
                         action = "store_true",
@@ -465,7 +472,7 @@ def main (args = None):
         mode = 'none'
 
     try:
-        r = STLSim(bp_sim_path = options.bp_sim_path)
+        r = STLSim(bp_sim_path = options.bp_sim_path, port_id = options.port_id)
 
         r.run(input_list = options.input_file,
               outfile = options.output_file,
index 2baa645..d4b817c 100644 (file)
@@ -835,7 +835,7 @@ class STLProfile(object):
 
 
     @staticmethod
-    def load_py (python_file):
+    def load_py (python_file, direction = 0, **kwargs):
         """ load from Python profile """
 
         # check filename
@@ -850,13 +850,13 @@ class STLProfile(object):
             module = __import__(file, globals(), locals(), [], -1)
             reload(module) # reload the update 
 
-            streams = module.register().get_streams()
+            streams = module.register().get_streams(direction = direction, **kwargs)
 
             return STLProfile(streams)
 
         except Exception as e:
             a, b, tb = sys.exc_info()
-            x =''.join(traceback.format_list(traceback.extract_tb(tb)[1:])) + a.__name__ + ": " + str(b) + "\n"
+            x =''.join(traceback.format_list(traceback.extract_tb(tb)[0:])) + a.__name__ + ": " + str(b) + "\n"
 
             summary = "\nPython Traceback follows:\n\n" + x
             raise STLError(summary)
@@ -940,14 +940,16 @@ class STLProfile(object):
       
 
     @staticmethod
-    def load (filename):
+    def load (filename, direction = 0, **kwargs):
         """ load a profile by its type supported type are 
            * py
            * yaml 
            * pcap file that converted to profile automaticly 
 
            :parameters:
-              filename : string as filename 
+              filename  : string as filename 
+              direction : profile's direction (if supported by the profile)
+              kwargs    : forward those key-value pairs to the profile
 
         """
 
@@ -955,7 +957,7 @@ class STLProfile(object):
         suffix = x[1] if (len(x) == 2) else None
 
         if suffix == 'py':
-            profile = STLProfile.load_py(filename)
+            profile = STLProfile.load_py(filename, direction, **kwargs)
 
         elif suffix == 'yaml':
             profile = STLProfile.load_yaml(filename)
@@ -996,7 +998,7 @@ class STLProfile(object):
 from trex_stl_lib.api import *
 
 class STLS1(object):
-    def get_streams(self):
+    def get_streams(self, direction = 0, **kwargs):
         streams = []
 '''
         for stream in self.streams:
index 849bbd1..8fcdca5 100644 (file)
@@ -38,7 +38,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index 817b677..978c892 100644 (file)
@@ -37,7 +37,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index 2604124..175b831 100644 (file)
@@ -39,7 +39,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index 393ea70..e1a8f88 100644 (file)
@@ -32,7 +32,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index e2701d2..69e1166 100644 (file)
@@ -4,7 +4,7 @@ from trex_stl_lib.api import *
 
 class STLS1(object):
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd 
                           mode = STLTXCont(pps=1000),
                           flow_stats = STLFlowStats(pg_id = 7)),
index f93ffc2..be612e5 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Missing values will be filled with defaults
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(frame_size = 100,
                             vlan_id = [1, 2, 3, 4], # can be either array or string separated by spaces
                             vlan_protocol_tag_id = '8100 0x8100', # hex with optional prefix '0x'
index 312c897..bac8a09 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Creates 3 streams (imix) Eth/802.1Q/IP/TCP without VM
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         #'''
         return STLHltStream(
                 #enable_auto_detect_instrumentation = '1', # not supported yet
index af40c2a..1fc7b84 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Creates 3 streams (imix) Eth/802.1Q/IP/TCP without VM
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(
                 #enable_auto_detect_instrumentation = '1', # not supported yet
                 ip_dst_addr = '192.168.3.3',
index 7b5442a..6192a7d 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Creates Eth/802.1Q/802.1Q/IP/TCP stream
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(
                 l3_protocol = 'ipv4',
                 ip_src_addr = '100.1.1.1',
index 2f88b32..9e5d3ea 100755 (executable)
@@ -10,7 +10,7 @@ class STLS1(object):
         MAC dst will have <mac_dst_count> number of incremental values
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         mac_dst_count = 10
         mac_src_count = 10
         pkts_per_burst = 10
index 5653e43..54ac41a 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Two Eth/IP/UDP streams with VM to get different size of packet by frame_size
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLHltStream(length_mode = 'increment',
                              frame_size_min = 100,
                              frame_size_max = 3000,
index 5b55d64..2764866 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Each stream will get rate_pps * his ratio / sum of ratios
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(length_mode = 'imix', rate_pps = 2,
                             l3_imix1_size = 60, l3_imix1_ratio = 4,
                             l3_imix2_size = 400, l3_imix2_ratio = 3,
index 3871924..607077b 100755 (executable)
@@ -3,7 +3,7 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
 
 class STLS1(object):
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(length_mode = 'imix', rate_pps = 2,
                             l3_protocol = 'ipv4', l4_protocol = 'udp')
 
index 3b6a040..7679e09 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Eth/IP/TCP stream with VM to get different ip addresses
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(split_by_cores = 'duplicate',
                             l3_protocol = 'ipv4',
                             ip_src_addr = '192.168.1.1',
index f90e715..2f6264d 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Eth/IPv6/UDP stream without VM, default values
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLHltStream(l3_protocol = 'ipv6',
                              l3_length = 150,
                              l4_protocol = 'udp',
index f9a83b5..b50cc48 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Eth/IPv6/UDP stream with VM, to change the ipv6 addr (only 32 lsb)
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(l3_protocol = 'ipv6', l3_length = 150, l4_protocol = 'udp',
                             ipv6_src_addr = '1111:2222:3333:4444:5555:6666:7777:8888',
                             ipv6_dst_addr = '1111:1111:1111:1111:1111:1111:1111:1111',
index 7b04fbe..bf22f12 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Two Eth/IP/UDP streams with VM to get different size of packet by l3_length
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLHltStream(length_mode = 'increment',
                              l3_length_min = 100,
                              l3_length_max = 3000,
index e6c4f0a..2ede1c4 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Eth/IP/UDP stream with VM, to change the MAC addr (only 32 lsb)
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(l3_protocol = 'ipv4', l4_protocol = 'udp',
                             mac_src = '10:00:00:00:00:01', mac_dst = '10:00:00:00:01:00',
                             mac_src2 = '11:11:00:00:00:01', mac_dst2 = '11:11:00:00:01:00',
index c29b707..e204533 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Eth/IP/TCP stream with VM to get 10 different TCP ports
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(l3_protocol = 'ipv4',
                             l4_protocol = 'tcp',
                             tcp_src_port_mode = 'decrement',
index 10c778e..711ced3 100755 (executable)
@@ -8,7 +8,7 @@ class STLS1(object):
     Seconds stream will decrease the packet size in reverse way
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         max_size = 9*1024
         return [STLHltStream(length_mode = 'increment',
                              frame_size_max = max_size,
index 9e551b9..52b49ad 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     The ports overlap the max and min at very first packets
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(l3_protocol = 'ipv4',
                             l4_protocol = 'udp',
                             udp_src_port_mode = 'decrement',
index 1ba0227..8fdde41 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Using "consistent_random = True" to have same random ports each test
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLHltStream(l3_protocol = 'ipv4',
                              l4_protocol = 'udp',
                              udp_src_port_mode = 'random',
index ea5c66d..86851c9 100755 (executable)
@@ -6,7 +6,7 @@ class STLS1(object):
     Default Eth/802.1Q/IP/TCP stream without VM
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(l2_encap = 'ethernet_ii_vlan',
                             l3_protocol = 'ipv4', l4_protocol = 'tcp',
                             direction = direction)
index a2ad102..70bf1aa 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Missing values will be filled with defaults
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return STLHltStream(frame_size = 100,
                             vlan_id = '1 2 1000 4 5',                          # 5 vlans
                             vlan_id_mode = 'increment fixed decrement random', # 5th vlan will be default fixed
index 6016c73..4cf949c 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Creates Eth/802.1Q/IP/UDP stream with  VM on src IP
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         ipv4_address_step = '0.0.1.0'
         num_of_sessions_per_spoke = 1000
         ip_tgen_hub = '190.1.0.1'
index 8250334..137e57b 100755 (executable)
@@ -7,7 +7,7 @@ class STLS1(object):
     Creates Eth/802.1Q/IPv6/UDP stream without VM (if num_of_sessions_per_spoke is 1)
     '''
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         ipv6_tgen_rtr = '2005:0:1::1'
         num_of_sessions_per_spoke = 1 # in given example is not passed forward, taking default
         ipv6_address_step = '0:0:0:1:0:0:0:0'
index 54208af..65e3510 100644 (file)
@@ -30,7 +30,7 @@ class STLImix(object):
                          mode = STLTXCont(pps = pps))
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
 
         if direction == 0:
             src = self.ip_range['src']
index 9922458..1a43ae9 100644 (file)
@@ -32,7 +32,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index d4b88a5..bcf2257 100644 (file)
@@ -7,11 +7,9 @@ class STLPcap(object):
     def __init__ (self, pcap_file):
         self.pcap_file = pcap_file
 
-    def get_streams (self,
-                     ipg_usec = 10.0,
-                     loop_count = 1):
+    def get_streams (self, direction = 0, **kwargs):
 
-        profile = STLProfile.load_pcap(self.pcap_file, ipg_usec = ipg_usec, loop_count = loop_count)
+        profile = STLProfile.load_pcap(self.pcap_file, ipg_usec = kwargs.get('ipg_usec', 10.0), loop_count = kwargs.get('loop_count', 1))
 
         return profile.get_streams()
 
index a073f95..6531a12 100644 (file)
@@ -29,14 +29,17 @@ class STLPcap(object):
         return vm
 
 
-    def get_streams (self,
-                     ipg_usec = 10.0,
-                     loop_count = 5,
-                     ip_src_range = None,
-                     ip_dst_range = {'start' : '10.0.0.1', 'end': '10.0.0.254'}):
+    def get_streams (self, direction = 0, **kwargs):
+
+        ip_src_range = kwargs.get('ip_src_range', None)
+        ip_dst_range = kwargs.get('up_dst_range', {'start' : '10.0.0.1', 'end': '10.0.0.254'})
 
         vm = self.create_vm(ip_src_range, ip_dst_range)
-        profile = STLProfile.load_pcap(self.pcap_file, ipg_usec = ipg_usec, loop_count = loop_count, vm = vm)
+
+        profile = STLProfile.load_pcap(self.pcap_file,
+                                       ipg_usec = kwargs.get('ipg_usec', 10.0),
+                                       loop_count = kwargs.get('loop_count', 5),
+                                       vm = vm)
 
         return profile.get_streams()
 
index e47d6e5..8979057 100644 (file)
@@ -34,7 +34,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index f6edcdd..b01a0c0 100644 (file)
@@ -43,7 +43,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 6b86a03..13516ec 100644 (file)
@@ -33,7 +33,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 0eeb214..4adffd7 100644 (file)
@@ -21,7 +21,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 00d7a97..0470042 100644 (file)
@@ -25,7 +25,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 1dc001c..1e5e4bd 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 6b36ca0..b9fac9b 100644 (file)
@@ -16,7 +16,7 @@ class STLS1(object):
                          mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index fd86239..d53416b 100644 (file)
@@ -23,7 +23,7 @@ class STLS1(object):
                          mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 94c9211..598e207 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index cc8dd40..efb45da 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index c3b242e..b95a32e 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 47b8a63..7a5d286 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index ed09cba..75f9bbf 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 5e46b8a..0ebd035 100644 (file)
@@ -22,7 +22,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 83093db..bd98416 100644 (file)
@@ -16,7 +16,7 @@ class STLS1(object):
                          mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 01ad5fe..366344b 100644 (file)
@@ -21,7 +21,7 @@ class STLS1(object):
                          mode = STLTXSingleBurst( pps = 1, total_pkts = 100) )
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index a0d2ee4..9fb0e26 100644 (file)
@@ -4,7 +4,7 @@ from trex_stl_lib.api import *
 
 class STLS1(object):
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd 
                          mode = STLTXCont(pps=10)) ] #rate continues, could be STLTXSingleBurst,STLTXMultiBurst
 
index 91b32d0..00b5e5d 100644 (file)
@@ -5,7 +5,7 @@ from trex_stl_lib.api import *
 
 class STLS1(object):
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         return [STLStream(packet = STLPktBuilder(pkt ="yaml/udp_64B_no_crc.pcap",
                                                  path_relative_to_profile = True), # path relative to profile and not to loader path
                          mode = STLTXCont(pps=10)) ] #rate continues, could be STLTXSingleBurst,STLTXMultiBurst
index 2754b3a..9bd3c33 100644 (file)
@@ -32,7 +32,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 69c2dfc..a8c71c0 100644 (file)
@@ -32,7 +32,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt/pad,vm = vm),
                          mode = STLTXCont( pps=10 ))
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 6e20ede..d7f48ed 100644 (file)
@@ -26,7 +26,7 @@ class STLS1(object):
         return STLStream(packet = STLPktBuilder(pkt = base_pkt,vm = vm),
                          mode = STLTXSingleBurst( pps=10, total_pkts = self.num_clients  )) # single burst of G-ARP
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 09643fe..0407f9c 100644 (file)
@@ -11,7 +11,7 @@ class STLS1(object):
                     ),
              mode = STLTXCont())
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index c337197..8ec8d97 100644 (file)
@@ -2,16 +2,8 @@ from trex_stl_lib.api import *
 
 class STLS1(object):
 
-    def create_stream (self):
-        return STLStream( 
-            packet = 
-                    STLPktBuilder(
-                        pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/
-                                UDP(dport=12,sport=1025)/(10*'x')
-                    ),
-             mode = STLTXCont())
-
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
+        
         # create 1 stream 
         if direction==0:
             src_ip="16.0.0.1"
index 6b72888..20b87cd 100644 (file)
@@ -9,7 +9,7 @@ class STLS1(object):
                           #mac_dst_override_mode=STLStreamDstMAC_PKT # another way to explictly take it
                           )
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index e3df0d0..9bdd4ed 100644 (file)
@@ -9,7 +9,7 @@ class STLS1(object):
                           #mac_dst_override_mode=STLStreamDstMAC_PKT # another way to explictly take it
                           )
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index fe5a2a8..ec930fe 100644 (file)
@@ -9,7 +9,7 @@ class STLS1(object):
                           #mac_src_override_by_pkt=True # another way to explictly take it
                           )
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 843d9bc..b2f8023 100644 (file)
@@ -30,7 +30,7 @@ class STLS1(object):
         return STLStream( packet = pkt_a ,
                           mode = STLTXCont() )
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 52c93a7..c261d3f 100644 (file)
@@ -30,7 +30,7 @@ class STLS1(object):
         return STLStream( packet = pkt_a ,
                           mode = STLTXCont() )
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index a278e4b..be8620c 100644 (file)
@@ -31,7 +31,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index c7a9894..304ed9c 100644 (file)
@@ -35,7 +35,7 @@ class STLS1(object):
         return stream
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 9d56fe3..eaebb9a 100644 (file)
@@ -38,7 +38,7 @@ class STLS1(object):
                          mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index 633c4b6..fd2c609 100644 (file)
@@ -26,7 +26,7 @@ class STLS1(object):
                             ]).get_streams()
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return self.create_stream() 
 
index b76b9fb..3628a07 100644 (file)
@@ -34,7 +34,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]
 
index c9339d2..c24101c 100644 (file)
@@ -35,7 +35,7 @@ class STLS1(object):
 
 
 
-    def get_streams (self, direction = 0):
+    def get_streams (self, direction = 0, **kwargs):
         # create 1 stream 
         return [ self.create_stream() ]