Skip to content

[TestCOPP] Add test configuration parameter for number of TX packets#208

Merged
pavel-shirshov merged 4 commits intosonic-net:masterfrom
volodymyrsamotiy:master
Jul 12, 2017
Merged

[TestCOPP] Add test configuration parameter for number of TX packets#208
pavel-shirshov merged 4 commits intosonic-net:masterfrom
volodymyrsamotiy:master

Conversation

@volodymyrsamotiy
Copy link
Copy Markdown
Contributor

No description provided.

@msftclas
Copy link
Copy Markdown

msftclas commented Jul 6, 2017

@volodymyrsamotiy,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave as default value?

- fail: msg="Please set ptf_host variable"
when: ptf_host is not defined

- fail: msg="Please set pkt_tx_count variable"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have previous constant as a default number of packets. This way test will be backward compatible

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Jul 6, 2017

@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']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

- fail: msg="Please set ptf_host variable"
when: ptf_host is not defined

- fail: msg="Please set pkt_tx_count variable"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@marian-pritsak marian-pritsak dismissed oleksandrivantsiv’s stale review July 7, 2017 13:59

Fixed in latest commit

ptf_qlen: 100000
ptf_test_params:
- verbose=False
- pkt_tx_count={{ pkt_tx_count|default(None) }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you initialize params dictionary here with None value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you will read this None value (probably as string), because you initialized it as default in ansible code.

@pavel-shirshov pavel-shirshov merged commit f11e48b into sonic-net:master Jul 12, 2017
lguohan pushed a commit that referenced this pull request Aug 3, 2017
…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
nhe-NV pushed a commit to nhe-NV/sonic-mgmt that referenced this pull request May 12, 2025
<!--
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?
-->
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants