self.config_plugin = config_plugin
self.factory = factory
self.notifier = notifier
- self.cred = credentials.Credentials(config.openrc_file, None, False) \
- if config.openrc_file else None
+ self.cred = credentials.Credentials(config.openrc_file, config.clouds_detail, None, False) \
+ if config.openrc_file or config.clouds_detail else None
self.chain_runner = None
self.specs = Specs()
self.specs.set_openstack_spec(openstack_spec)
# check that an empty openrc file (no OpenStack) is only allowed
# with EXT chain
- if not self.config.openrc_file and self.config.service_chain != ChainType.EXT:
- raise Exception("openrc_file in the configuration is required for PVP/PVVP chains")
+ if (not self.config.openrc_file and not self.config.clouds_detail) and \
+ self.config.service_chain != ChainType.EXT:
+ raise Exception("openrc_file or clouds_detail in the configuration is required"
+ " for PVP/PVVP chains")
self.specs.set_run_spec(self.config_plugin.get_run_spec(self.config,
self.specs.openstack))
config.cache_size = config.flow_count
# The size must be capped to 10000 (where does this limit come from?)
- if config.cache_size > 10000:
- config.cache_size = 10000
+ config.cache_size = min(config.cache_size, 10000)
config.duration_sec = float(config.duration_sec)
config.interval_sec = float(config.interval_sec)
action='store_true',
help='Use L3 neutron routers to handle traffic')
+ parser.add_argument('-garp', '--gratuitous-arp', dest='periodic_gratuitous_arp',
+ default=None,
+ action='store_true',
+ help='Use gratuitous ARP to maintain session between TG '
+ 'and L3 routers to handle traffic')
+
parser.add_argument('-0', '--no-traffic', dest='no_traffic',
default=None,
action='store_true',
'tagged with given VLAN id(s) or not (given \'no-tag\') '
'\'true\': use current vlans; \'false\': disable this mode.')
+ parser.add_argument('--i40e-mixed', dest='i40e_mixed',
+ action='store',
+ default=None,
+ metavar='<ignore,check,unbind>',
+ help='TRex behavior when dealing with a i40e network card driver'
+ ' [ https://trex-tgn.cisco.com/youtrack/issue/trex-528 ]')
+
parser.add_argument('--user-info', dest='user_info',
action='append',
metavar='<data>',
sys.exit(0)
if opts.summary:
- with open(opts.summary) as json_data:
+ with open(opts.summary, encoding="utf-8") as json_data:
result = json.load(json_data)
if opts.user_label:
result['config']['user_label'] = opts.user_label
# dump the contents of the trex log file
if opts.show_trex_log:
try:
- print(open('/tmp/trex.log').read(), end="")
+ with open('/tmp/trex.log', encoding="utf-8") as trex_log_file:
+ print(trex_log_file.read(), end="")
except FileNotFoundError:
print("No TRex log file found!")
sys.exit(0)
config.service_chain_count = len(vlans[0])
opts.l2_loopback = None
+ if config.i40e_mixed is None:
+ config.i40e_mixed = 'ignore'
if config.use_sriov_middle_net is None:
config.use_sriov_middle_net = False
if opts.use_sriov_middle_net is not None: