def _create_profile(self, profile_data, rate, port_pg_id): """Create a STL profile (list of streams) for a port""" streams = [] for packet_name in profile_data: imix = (profile_data[packet_name].get('outer_l2', {}).get('framesize')) imix_data = self._create_imix_data(imix) self._create_vm(profile_data[packet_name]) _streams = self._create_streams(imix_data, rate, port_pg_id) streams.extend(_streams) return trex_stl_streams.STLProfile(streams)
def create_profile(self, profile_data, current_port): streams = [] for packet_name in profile_data: imix = (profile_data[packet_name].get('outer_l2', {}).get('framesize')) self.pkt_size, imix_sum = self.calculate_frame_size(imix) self._create_vm(profile_data[packet_name]) if self.max_rate > 100: imix_data = self._create_imix_data( imix, constants.DISTRIBUTION_IN_PACKETS) else: imix_data = self._create_imix_data(imix) _streams = self._create_single_stream(current_port, imix_data, imix_sum) streams.extend(_streams) return trex_stl_streams.STLProfile(streams)