Skip to content

fix test break in t1-lag-64 topology, make the search more restrict#683

Merged
maggiemsft merged 2 commits intosonic-net:masterfrom
maggiemsft:masun/fix_nei_noptf
Aug 20, 2018
Merged

fix test break in t1-lag-64 topology, make the search more restrict#683
maggiemsft merged 2 commits intosonic-net:masterfrom
maggiemsft:masun/fix_nei_noptf

Conversation

@maggiemsft
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Fixes test fail in one topology

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

make the grep search more restrict to avoid test fail.

How did you verify/test it?

verified in my local testbed t1-lag-64, it was failed before, and pass now.
Also verified in t1 topology

Any platform specific information?

No

Supported testbed topology if it's a new test case?

NA

Documentation


- name: Get the SONiC Asic DB key holding neighbour MAC for {{ v4_nei }}
shell: docker exec database redis-cli -n 1 KEYS ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY* | grep {{ v4_nei }}
shell: docker exec database redis-cli -n 1 KEYS ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY* | grep '\"{{ v4_nei }}\"'
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.

grep [](start = 97, length = 4)

Use exact fix-string match instead of regex match, because there is '.' in IP string.

 grep -Fe 

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

As comment

@maggiemsft maggiemsft merged commit af7908c into sonic-net:master Aug 20, 2018
wangxin pushed a commit to wangxin/sonic-mgmt that referenced this pull request Oct 27, 2025
…onic-net#683)

<!--
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.
-->
We need to add a parsing logic per the transceiver onboarding plan
(section "Pre-requisites for the Below Tests") so that the transceiver
specific data can be used to execute transceiver specific testcases.

[Transceiver Onboarding Test Plan by mihirpat1 · Pull Request sonic-net#10130 ·
sonic-net/sonic-mgmt](sonic-net#10130)

Summary:

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [x] Testbed and Framework(new/improvement)
- [x] 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?
Add parsing logic for transceiver inventory file. For the details of the
parsing logic and the inventory file, please refer to section
"Pre-requisites for the Below Tests" in [Transceiver Onboarding Test
Plan by mihirpat1 · Pull Request sonic-net#10130 ·
sonic-net/sonic-mgmt](sonic-net#10130)

#### How did you do it?
1. Added `transceiver_inventory` function with module scope to parse
transceiver inventory file.
2. Created test_check_show_int_transceiver_eeprom function to test the
parsing code and verify that the transceiver EEPROM of DUT is inline
with the inventory data defined in `transceiver_common_attributes.csv`
and `transceiver_dut_info.csv` files. The
`test_ptp_show_intf_transceiver.py` is planned to be modified in future
to have more testcases related to `show interfaces transceiver` related
CLIs.
3. The current tests in `test_ptp_show_intf_transceiver.py` are
applicable only to ptp-256 topology since the transceiver onboarding
suite of tests is specific to ptp based topology.

Future enhancements
1. We need to create an optimized way to find the logical port to
physical port dictionary. Currently, this information is retrieved from
the device via `get_physical_port_indices` and is time consuming since
this function invokes the redis-db CLI equivalent to the number of
logical ports on the DUT.
2. Additional logic to parse raw firmware binary and its metadata.

#### How did you verify/test it?
Test passed for `ptp-256` topology
```
patelmi@temp2:/var/src/mgmt_int/tests$ ./run_tests.sh -c $test_path -n $tb_name -i ../ansible/$tb_str,../ansible/veos -u -e "--skip_sanity --disable_loganalyzer" -t 'ptp-256'
.
======================================================================= warnings summary ========================================================================
../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
  /usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
    "class": algorithms.Blowfish,

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------- generated xml file: /var/src/mgmt_int/tests/logs/tr.xml ----------------------------------------------------
=========================================================== 1 passed, 1 warning in 244.13s (0:04:04) ============================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_check_show_int_transceiver_eeprom[str3-7060x6-64pe-4-None]>
INFO:root:Can not get Allure report URL. Please check logs
patelmi@temp2:/var/src/mgmt_int/tests$
```

Test skipped for other topology
```
patelmi@temp2:/var/src/mgmt_int/tests$ ./run_tests.sh -c $test_path -n $tb_name -i ../ansible/$tb_str,../ansible/veos -u -e "--skip_sanity --disable_loganalyzer" -t 'ptp'
=== Running tests in groups ===
.
transceiver/eeprom_tests/test_transceiver_eeprom.py::test_check_show_int_transceiver_eeprom[str3-7060x6-64pe-4-None] SKIPPED (test requires topology ...) [100%]

======================================================================= warnings summary ========================================================================
../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
  /usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
    "class": algorithms.Blowfish,

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------- generated xml file: /var/src/mgmt_int/tests/logs/tr.xml ----------------------------------------------------
==================================================================== short test summary info ====================================================================
SKIPPED [1] transceiver/eeprom_tests/test_transceiver_eeprom.py: test requires topology in Mark(name='topology', args=('ptp-256',), kwargs={})
================================================================ 1 skipped, 1 warning in 32.67s =================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_check_show_int_transceiver_eeprom[str3-7060x6-64pe-4-None]>
INFO:root:Can not get Allure report URL. Please check logs
patelmi@temp2:/var/src/mgmt_int/tests$
```
#### Any platform specific information?

#### Supported testbed topology if it's a new test case?
`ptp-256`

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

https://github.com/sonic-net/sonic-mgmt/pull/10130/files?short_path=1707bc9#diff-1707bc9546f32667883a248c43fb8433faabd02ed0e09fe6bf430540ee4bea31

MSFT ADO - 31582995
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Submodule src/sonic-utilities 5b1fa3c..7bb6ffb:
  > [fast reboot] kill teamd docker directly (sonic-net#683)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Submodule src/sonic-utilities 2d721de..fb5902f:
  > Revert "[fast reboot] kill teamd docker directly (sonic-net#683)" (sonic-net#690)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants