[TestCOPP] Add test configuration parameter for number of TX packets#208
[TestCOPP] Add test configuration parameter for number of TX packets#208pavel-shirshov merged 4 commits intosonic-net:masterfrom volodymyrsamotiy:master
Conversation
|
@volodymyrsamotiy, |
| PPS_LIMIT_MIN = PPS_LIMIT * 0.9 | ||
| PPS_LIMIT_MAX = PPS_LIMIT * 1.1 | ||
| NO_POLICER_LIMIT = PPS_LIMIT * 1.4 | ||
| PKT_TX_COUNT = 100000 |
There was a problem hiding this comment.
Leave as default value?
ansible/roles/test/tasks/copp.yml
Outdated
| - fail: msg="Please set ptf_host variable" | ||
| when: ptf_host is not defined | ||
|
|
||
| - fail: msg="Please set pkt_tx_count variable" |
There was a problem hiding this comment.
We can have previous constant as a default number of packets. This way test will be backward compatible
|
@pavel-shirshov to check |
| self.log_fp = open('/tmp/copp.log', 'a') | ||
| test_params = testutils.test_params_get() | ||
| self.verbose = 'verbose' in test_params and test_params['verbose'] | ||
| self.pkt_tx_count = 'pkt_tx_count' in test_params and test_params['pkt_tx_count'] |
There was a problem hiding this comment.
self.pkt_tx_count would be False if it's not in test_params.
Also I'd avoid save values with different types in one variable. (False or 100000)
ansible/roles/test/tasks/copp.yml
Outdated
| - fail: msg="Please set ptf_host variable" | ||
| when: ptf_host is not defined | ||
|
|
||
| - fail: msg="Please set pkt_tx_count variable" |
| self.log_fp = open('/tmp/copp.log', 'a') | ||
| test_params = testutils.test_params_get() | ||
| self.verbose = 'verbose' in test_params and test_params['verbose'] | ||
| self.pkt_tx_count = 'pkt_tx_count' in test_params and test_params['pkt_tx_count'] |
There was a problem hiding this comment.
test_params is dictionary. Probably will be better:
test_params.get("pkt_tx_count", self.PKT_TX_COUNT)
Where self.PKT_TX_COUNT is default value
ansible/roles/test/tasks/copp.yml
Outdated
| ptf_qlen: 100000 | ||
| ptf_test_params: | ||
| - verbose=False | ||
| - pkt_tx_count={{ pkt_tx_count|default(None) }} |
There was a problem hiding this comment.
you initialize params dictionary here with None value.
There was a problem hiding this comment.
I'd better used something like:
default(0)
and in the test I'd use
if self.pkt_tx_count == 0:
self.pkt_tx_count = PKT_TX_COUNT
I don't know better way to omit pkt_tx_count from ptf_test_params in Ansible.
Probably
{% if pkt_tx_count is defined %} - pkt_tx_count={{ pkt_tx_count }} {% endif %}
will work but I didn't check it
| self.log_fp = open('/tmp/copp.log', 'a') | ||
| test_params = testutils.test_params_get() | ||
| self.verbose = 'verbose' in test_params and test_params['verbose'] | ||
| self.pkt_tx_count = test_params.get('pkt_tx_count', self.PKT_TX_COUNT) |
There was a problem hiding this comment.
Here you will read this None value (probably as string), because you initialized it as default in ansible code.
…208) * [TestCOPP] Add test configuration parameter for number of TX packets * [TestCOPP] Add test configuration parameter for number of TX packets * Fix comments * [TestCOPP] Add test configuration parameter for number of TX packets * Fix comments * [TestCOPP] Add test configuration parameter for number of TX packets * Fix comments
<!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Fixes # (issue) ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202012 - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 ### Approach #### What is the motivation for this PR? The eos default cred is all digits. It may be interpreted as an integer and raise below error during tests: ``` File "/var/src/sonic-mgmt/tests/common/devices/eos.py", line 85, in shutdown out = self.eos_config( File "/var/src/sonic-mgmt/tests/common/devices/base.py", line 131, in _run raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res) tests.common.errors.RunAnsibleModuleFail: run module eos_config failed, Ansible Results => failed = True module_stdout = module_stderr = Expected unicode or bytes, got 123456 msg = MODULE FAILURE See stdout/stderr for the exact error _ansible_no_log = None changed = False stdout = stderr = ``` #### How did you do it? Add quote to the all digits default cred to force string type. #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
…aemons (sonic-net#8607) This PR updates the following commits in sonic-platform-common 9d2e7d5 Add y-cable driver for simulated mux (sonic-net#213) e3e8f09 [Y-Cable][Broadcom] Broadcom implementation of YCable class which inherits from YCableBase required for Y-Cable API's in sonic-platform-daemons (sonic-net#208) This PR updates the following commits in sonic-platform-daemons ebc4f3f [Y-Cable] create unknown entries for mux_cable when there is a cable present but module definition is not present/invalid module b10c417 [xcvrd] initial support for integrating vendor specfic class objects for calling Y-Cable API's inside xcvrd (sonic-net#197) (sonic-net#213) f3fc1ea [y-cable] fix for logging the xcvrd metrics before writing the state to the State-DB (sonic-net#208) Signed-off-by: vaibhav-dahiya <[email protected]>
No description provided.