[ptf_runner] Save ptf log to script executing host in case of failure#823
[ptf_runner] Save ptf log to script executing host in case of failure#823lguohan merged 2 commits intosonic-net:masterfrom wangxin:ptf-log-review
Conversation
The PTF log and pcap files are useful for debugging in case of PTF script failed. However, these files are in the PTF container and could be lost when the PTF container is re-deployed. This improvement is to save the log and pcap files to the script executing host when the PTF script is failed. Signed-off-by: Xin Wang <xinw@mellanox.com>
|
@liat-grozovik PTF log files save location: Log analyzer output files save location: To avoid overwritten, timestampe appended to the PTF logfiles while saving them to sonic-mgmt. |
volodymyrsamotiy
left a comment
There was a problem hiding this comment.
Since this PR changes default behavior, I am just thinking maybe it is better to have all new copy logic under some condition.
So we don't change default behavior and if some option is passed only then logs are copied to specified location.
For example something like: ansible-playbook <some_test>.yml ... -e save-ptf-log=</dest/location/>
@wangxin, what do you think?
|
|
||
| - name: Set default PTF log filename | ||
| set_fact: | ||
| ptf_log_file: "/root/ptf.log" |
There was a problem hiding this comment.
Here default PTF log file is set to /root/ptf.log, but all tests use /tmp/.
I believe it would be better to change this default to /tmp/ as well, so we have all logs in one place.
There was a problem hiding this comment.
This code is to specify where to get the PTF log and pcap files from the PTF container.
When PTF log file is not explicitly specified while calling ptf_runner.yml, PTF saves default log and pcap files to /root/ptf.log and /root/ptf.pcap on PTF container.
If explicit log file parameter is parsed from the PTF command line, this default value will be overwritten with custom log file location.
pavel-shirshov
left a comment
There was a problem hiding this comment.
Let's save the logs in succesful runs too.
|
@volodymyrsamotiy I agree that your proposal has two advantages:
|
The previous commit changed the default behavior. This change is to add an option for specifying whether to save ptf log in case of failure. For example: ansible-playbook <some_test>.yml ... -e save_ptf_log=yes
|
@volodymyrsamotiy |
|
@pavel-shirshov can you please review as well? if all good, we can move on and merge. |
pavel-shirshov
left a comment
There was a problem hiding this comment.
How can we know that target dir 'test/{{ inventory_hostname }}/ptf/' is valid?
|
@pavel-shirshov |
…#823) * [ptf_runner] Save ptf log to script executing host in case of failure The PTF log and pcap files are useful for debugging in case of PTF script failed. However, these files are in the PTF container and could be lost when the PTF container is re-deployed. This improvement is to save the log and pcap files to the script executing host when the PTF script is failed. Signed-off-by: Xin Wang <xinw@mellanox.com> * [ptf_runner] Add option for specifying whether to save ptf log The previous commit changed the default behavior. This change is to add an option for specifying whether to save ptf log in case of failure. For example: ansible-playbook <some_test>.yml ... -e save_ptf_log=yes
…t#21097) (sonic-net#823) What is the motivation for this PR? We want to add a full topo with 448 neighbors; the previous configuration and memory limitation cannot meet its requirement. How did you do it? Increase the memory limitation of PTF and increase the max number of inotify user instances. How did you verify/test it? Check it locally
Commits: 02dea43 [202012] Add support for BFD notification (sonic-net#990) 337fd97 Change sonic-buildimage.vs artifact source from CI build to official build. (sonic-net#992) 490f442 Support for cisco-8000 platform for sonic-sairedis/syncd (sonic-net#823)
Description of PR
Summary:
Fixes # (issue)
The PTF log and pcap files are useful for debugging in case of PTF
script failed. However, these files are in the PTF container and could
be lost when the PTF container is re-deployed.
This improvement is to save the log and pcap files to the script
executing host when the PTF script is failed.
Type of change
Approach
How did you do it?
When the PTF script failed, copy the PTF log and pcap files to sonic-mgmt container for later debugging.
How did you verify/test it?
Tested on Mellanox platform.
Any platform specific information?
No
Supported testbed topology if it's a new test case?
Documentation