diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-02-11 18:23:39 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-02-11 18:23:39 +0200 |
commit | 2312f48f6cee5c9aa2448ec5dcd41be32bbe5ead (patch) | |
tree | fde623d4ca66e1479b6aa7d8264d6f6de6db4b48 /scripts/automation | |
parent | 19ef256b19acefef392185bac65a93725c6aef27 (diff) | |
parent | 4a4068c1d010f3ffbec1f29dab8a482d51e98537 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'scripts/automation')
-rw-r--r-- | scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py | 2 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py index df1bd7e8..914c952d 100644 --- a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py +++ b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py @@ -178,7 +178,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ]; - p0 =[ ["udp_1pkt_pcap_relative_path.py","-m 1 -l 3",True] ] + p1 = [ ["udp_1pkt_tuple_gen_split.py","-m 1 -l 3",True] ] for obj in p: diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py index 0b90d3e1..f1462ede 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py @@ -153,12 +153,14 @@ class CTRexScTrimPacketSize(CTRexScriptsBase): if min_pkt_size > max_pkt_size: raise CTRexPacketBuildException(-11, 'CTRexScTrimPacketSize min_pkt_size is bigger than max_pkt_size '); + class CTRexScRaw(CTRexScriptsBase): """ raw instructions """ - def __init__(self,list_of_commands=None): + def __init__(self,list_of_commands=None,split_by_field=None): super(CTRexScRaw, self).__init__() + self.split_by_field = split_by_field if list_of_commands==None: self.commands =[] else: @@ -819,6 +821,14 @@ class CScapyTRexPktBuilder(CTrexPktBuilderInterface): for desc in obj.commands: self.vm_low_level.add_ins(desc.get_obj()); + # set split_by_var + if obj.split_by_field : + assert type(obj.split_by_field)==str, "type of split by var should be string" + #if not vars.has_key(obj.split_by_field): + # raise CTRexPacketBuildException(-11,("variable %s does not exists. change split_by_var args ") % (var_name) ); + + self.vm_low_level.split_by_var = obj.split_by_field + def _pkt_layer_offset (self,layer_name): assert self.pkt != None, 'empty packet' |