# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
from resources.libraries.python.constants import Constants
from resources.libraries.python.ssh import SSH
from resources.libraries.python.constants import Constants
from resources.libraries.python.ssh import SSH
"export PYTHONPATH=${{PWD}}; " +
". ${{PWD}}/env/bin/activate; " +
"resources/traffic_scripts/{} {}") \
.format(Constants.REMOTE_FW_DIR, script_file_name,
script_args)
"export PYTHONPATH=${{PWD}}; " +
". ${{PWD}}/env/bin/activate; " +
"resources/traffic_scripts/{} {}") \
.format(Constants.REMOTE_FW_DIR, script_file_name,
script_args)
- (ret_code, stdout, stderr) = ssh.exec_command_sudo(
- 'sh -c "{}"'.format(TrafficScriptExecutor._escape(cmd)),
+ ret_code, stdout, stderr = ssh.exec_command_sudo(
+ 'sh -c "{cmd}"'.format(cmd=TrafficScriptExecutor._escape(cmd)),
raise RuntimeError("TCP/UDP Rx timeout")
elif "Error occurred: ARP reply timeout" in stdout:
raise RuntimeError("ARP reply timeout")
raise RuntimeError("TCP/UDP Rx timeout")
elif "Error occurred: ARP reply timeout" in stdout:
raise RuntimeError("ARP reply timeout")