diff options
author | imarom <imarom@cisco.com> | 2016-01-04 09:49:37 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-01-04 10:02:59 -0500 |
commit | 857bdcf05a920b99e1cf180c700176b04801da00 (patch) | |
tree | a524225219e462c12817e3a710905cb6e27d9c9d /scripts | |
parent | e134270a3bcf3c9498a2926ffea1d7bb0d4960eb (diff) |
some additions to the stateless simulation mode
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/automation/trex_control_plane/client/trex_stateless_sim.py | 32 | ||||
-rw-r--r-- | scripts/stl/burst_1pkt_vm.yaml | 34 |
2 files changed, 63 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_stateless_sim.py b/scripts/automation/trex_control_plane/client/trex_stateless_sim.py index 7829af60..7655b27c 100644 --- a/scripts/automation/trex_control_plane/client/trex_stateless_sim.py +++ b/scripts/automation/trex_control_plane/client/trex_stateless_sim.py @@ -38,13 +38,15 @@ import os class SimRun(object): - def __init__ (self, yaml_file, dp_core_count, core_index, packet_limit, output_filename): + def __init__ (self, yaml_file, dp_core_count, core_index, packet_limit, output_filename, is_valgrind, is_gdb): self.yaml_file = yaml_file self.output_filename = output_filename self.dp_core_count = dp_core_count self.core_index = core_index self.packet_limit = packet_limit + self.is_valgrind = is_valgrind + self.is_gdb = is_gdb # dummies self.handler = 0 @@ -97,7 +99,14 @@ class SimRun(object): f.close() try: - subprocess.call(['bp-sim-64-debug', '--sl', '-f', f.name, '-o', self.output_filename]) + cmd = ['bp-sim-64-debug', '--sl', '--cores', str(self.dp_core_count), '--core_index', str(self.core_index), '-f', f.name, '-o', self.output_filename] + if self.is_valgrind: + cmd = ['valgrind', '--leak-check=full'] + cmd + elif self.is_gdb: + cmd = ['gdb', '--args'] + cmd + + subprocess.call(cmd) + finally: os.unlink(f.name) @@ -149,6 +158,17 @@ def setParserOptions(): type = unsigned_int) + group = parser.add_mutually_exclusive_group() + + group.add_argument("-x", "--valgrind", + help = "run under valgrind [default is False]", + action = "store_true", + default = False) + + group.add_argument("-g", "--gdb", + help = "run under GDB [default is False]", + action = "store_true", + default = False) return parser @@ -165,7 +185,13 @@ def main (): validate_args(parser, options) - r = SimRun(options.input_file, options.cores, options.core_index, options.limit, options.output_file) + r = SimRun(options.input_file, + options.cores, + options.core_index, + options.limit, + options.output_file, + options.valgrind, + options.gdb) r.run() diff --git a/scripts/stl/burst_1pkt_vm.yaml b/scripts/stl/burst_1pkt_vm.yaml new file mode 100644 index 00000000..e202b42d --- /dev/null +++ b/scripts/stl/burst_1pkt_vm.yaml @@ -0,0 +1,34 @@ +### Single stream UDP packet, 64B ### +##################################### +- name: udp_64B + stream: + self_start: True + packet: + binary: stl/udp_64B_no_crc.pcap # pcap should not include CRC + mode: + type: single_burst + total_pkts: 100 + pps: 100 + rx_stats: [] + + vm: + instructions: [ + { + "init_value" : 100, + "max_value" : 5000, + "min_value" : 100, + "name" : "l3_src", + "op" : "inc", + "size" : 2, + "type" : "flow_var" + }, + { + "add_value" : 1, + "is_big_endian" : true, + "name" : "l3_src", + "pkt_offset" : 34, + "type" : "write_flow_var" + } + ] + split_by_var: "l3_src" + |