"""This run() method is called for every NFVbench benchmark request.
In CLI mode, this method is called only once per invocation.
In REST server mode, this is called once per REST POST request
"""This run() method is called for every NFVbench benchmark request.
In CLI mode, this method is called only once per invocation.
In REST server mode, this is called once per REST POST request
# recalc the running config based on the base config and options for this run
self._update_config(opts)
# recalc the running config based on the base config and options for this run
self._update_config(opts)
# 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:
# 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:
parser.add_argument('-ss', '--show-summary', dest='summary',
action='store',
parser.add_argument('-ss', '--show-summary', dest='summary',
action='store',
LOG.info('Loading configuration string: %s', opts.config)
config = config_loads(opts.config, config, whitelist_keys)
LOG.info('Loading configuration string: %s', opts.config)
config = config_loads(opts.config, config, whitelist_keys)
# setup the fluent logger as soon as possible right after the config plugin is called,
# if there is any logging or result tag is set then initialize the fluent logger
for fluentd in config.fluentd:
# setup the fluent logger as soon as possible right after the config plugin is called,
# if there is any logging or result tag is set then initialize the fluent logger
for fluentd in config.fluentd:
if config.service_chain == ChainType.PVVP and config.use_sriov_middle_net:
check_physnet("middle", config.internal_networks.middle)
if config.service_chain == ChainType.PVVP and config.use_sriov_middle_net:
check_physnet("middle", config.internal_networks.middle)
# update the config in the config plugin as it might have changed
# in a copy of the dict (config plugin still holds the original dict)
config_plugin.set_config(config)
# update the config in the config plugin as it might have changed
# in a copy of the dict (config plugin still holds the original dict)
config_plugin.set_config(config)
server.run(host=opts.host, port=port)
# server.run() should never return
else:
server.run(host=opts.host, port=port)
# server.run() should never return
else:
opts = {k: v for k, v in list(vars(opts).items()) if v is not None}
# get CLI args
params = ' '.join(str(e) for e in sys.argv[1:])
opts = {k: v for k, v in list(vars(opts).items()) if v is not None}
# get CLI args
params = ' '.join(str(e) for e in sys.argv[1:])