import argparse
import json
-sys.path.insert(0, "/opt/trex-core-2.28/scripts/automation/"
+sys.path.insert(0, "/opt/trex-core-2.35/scripts/automation/"
"trex_control_plane/stl/")
from trex_stl_lib.api import *
print("### Profile file:\n{}".format(profile_file))
profile = STLProfile.load(profile_file, direction=0, port_id=0,
framesize=framesize)
- print("\n### Profiles ###\n")
- print(profile.dump_to_yaml())
streams = profile.get_streams()
- except STLError:
- print("Error while loading profile '{0}'\n".format(profile_file))
+ except STLError as err:
+ print("Error while loading profile '{0}' {1}".format(profile_file, err))
sys.exit(1)
try:
client.reset(ports=[port_0, port_1])
client.remove_all_streams(ports=[port_0, port_1])
+ if "macsrc" in profile_file:
+ client.set_port_attr(ports=[port_0, port_1], promiscuous=True,
+ resolve=False)
if isinstance(framesize, int):
client.add_streams(streams[0], ports=[port_0])
client.add_streams(streams[1], ports=[port_1])