Skip to content

[ptf]: Update remote platform port map#251

Merged
pavel-shirshov merged 1 commit intosonic-net:masterfrom
stcheng:remote
Aug 29, 2017
Merged

[ptf]: Update remote platform port map#251
pavel-shirshov merged 1 commit intosonic-net:masterfrom
stcheng:remote

Conversation

@stcheng
Copy link
Copy Markdown
Contributor

@stcheng stcheng commented Aug 28, 2017

This change is made due to the situation I meet that in the /proc/net/dev file, not all interfaces are populated. See below:

Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
 eth61: 4443030   22375    0 9685    0     0          0         0        0       0    0    0    0     0       0          0
 eth44: 4407872   22369    0 9693    0     0          0         0        0       0    0    0    0     0       0          0
 eth39: 4429251   22358    0 9695    0     0          0         0        0       0    0    0    0     0       0          0
 eth52: 4370210   22349    0 9683    0     0          0         0        0       0    0    0    0     0       0          0
 eth20: 3596469   20342    0 9700    0     0          0         0        0       0    0    0    0     0       0          0
  eth5: 3278642   20228    0 9693    0     0          0         0        0       0    0    0    0     0       0          0
 eth47: 4405016   22337    0 9693    0     0          0         0        0       0    0    0    0     0       0          0
 eth16: 3985129   20270    0 9694    0     0          0         0        0       0    0    0    0     0       0          0
 eth55: 4423247   22373    0 9685    0     0          0         0        0       0    0    0    0     0       0          0
 eth60: 4362326   22303    0 9695    0     0          0         0        0       0    0    0    0     0       0          0
 eth38: 4376767   22364    0 9687    0     0          0         0        0       0    0    0    0     0       0          0
  eth1: 2945543   19977    0 9691    0     0          0         0        0       0    0    0    0     0       0          0
 eth34: 5094781   22999    0 9698    0     0          0         0        0       0    0    0    0     0       0          0
 eth42: 4488027   22417    0 9693    0     0          0         0        0       0    0    0    0     0       0          0
 eth46: 4417958   22368    0 9695    0     0          0         0        0       0    0    0    0     0       0          0
  mgmt: 58671550  575320    0    0    0     0          0         0   566702    2613    0    0    0     0       0          0
 eth54: 4432899   22370    0 9685    0     0          0         0        0       0    0    0    0     0       0          0
 eth37: 4381439   22351    0 9687    0     0          0         0        0       0    0    0    0     0       0          0
 eth58: 4397105   22359    0 9696    0     0          0         0        0       0    0    0    0     0       0          0
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 eth63: 4372846   22356    0 9688    0     0          0         0        0       0    0    0    0     0       0          0
 eth50: 4377040   22321    0 9697    0     0          0         0        0       0    0    0    0     0       0          0
  eth0: 1943996   12078    0 9690    0     0          0         0        0       0    0    0    0     0       0          0
 eth45: 4431256   22386    0 9689    0     0          0         0        0       0    0    0    0     0       0          0
 eth53: 4377204   22386    0 9683    0     0          0         0        0       0    0    0    0     0       0          0
 eth21: 2188151   12383    0 9699    0     0          0         0        0       0    0    0    0     0       0          0
 eth36: 4382149   22326    0 9689    0     0          0         0        0       0    0    0    0     0       0          0
 eth62: 4388033   22380    0 9685    0     0          0         0        0       0    0    0    0     0       0          0
  eth4: 2294856   12560    0 9695    0     0          0         0        0       0    0    0    0     0       0          0
 eth17: 2217988   12626    0 9694    0     0          0         0        0       0    0    0    0     0       0          0

Since the interface index itself is indicating the port map, there is no need to sort and remap the port map.

Copy link
Copy Markdown
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

@pavel-shirshov pavel-shirshov merged commit 2a06cb6 into sonic-net:master Aug 29, 2017
@stcheng stcheng deleted the remote branch September 6, 2017 00:32
@chenkelly
Copy link
Copy Markdown
Contributor

chenkelly commented Sep 30, 2019

Hi @stcheng @yxieca
Please advise us your suggestion.
We build PTF docker according to https://github.com/Azure/sonic-mgmt/blob/master/ansible/doc/README.testbed.Setup.md
When we run ansible testbed, we found that remote_port_map only define eth0~eth31 in remote.py for PTF docker and it resulted in lag_2 test case failed in t0-56 topology.
We think your modification shall put to PTF docker.
Could you teach us how to replace remote.py for SONiC ansible test?
Thanks very much.

root@4a1cc65a953f:~# cat /usr/lib/python2.7/dist-packages/ptf/platforms/remote.py
"""
Remote platform 

This platform uses physical ethernet interfaces.
""" 

# Update this dictionary to suit your environment.
remote_port_map = {
    (0, 0) : "eth0",
    (0, 1) : "eth1",
    (0, 2) : "eth2",
    (0, 3) : "eth3",
    (0, 4) : "eth4",
    (0, 5) : "eth5",
    (0, 6) : "eth6",
    (0, 7) : "eth7",
    (0, 8) : "eth8",
    (0, 9) : "eth9",
    (0, 10) : "eth10",
    (0, 11) : "eth11",
    (0, 12) : "eth12",
    (0, 13) : "eth13",
    (0, 14) : "eth14",
    (0, 15) : "eth15",
    (0, 16) : "eth16",
    (0, 17) : "eth17",
    (0, 18) : "eth18",
    (0, 19) : "eth19",
    (0, 20) : "eth20",
    (0, 21) : "eth21",
    (0, 22) : "eth22",
    (0, 23) : "eth23",
    (0, 24) : "eth24",
    (0, 25) : "eth25",
    (0, 26) : "eth26",
    (0, 27) : "eth27",
    (0, 28) : "eth28",
    (0, 29) : "eth29",
    (0, 30) : "eth30",
    (0, 31) : "eth31"
}   

def platform_config_update(config):
    """
    Update configuration for the remote platform    

    @param config The configuration dictionary to use/update
    """
    global remote_port_map
    config["port_map"] = remote_port_map.copy()
    config["caps_table_idx"] = 0

@pavel-shirshov
Copy link
Copy Markdown
Contributor

@chenkelly: Don't use remote.py from ptf.
Use this: https://github.com/Azure/sonic-mgmt/blob/master/ansible/roles/test/files/ptftests/remote.py
You can enable it in ptf using following comand-line options:
--platform-dir ptftests --platform remote
put sonic remote.py into dir ptftests. Check how other tests using this.

@chenkelly
Copy link
Copy Markdown
Contributor

@pavel-shirshov
Thanks very much.
I modify lag part (PR: #1146) and test is passed according to your suggestion.

@pavel-shirshov
Copy link
Copy Markdown
Contributor

@chenkelly No problem. Good to know :)

auspham pushed a commit to auspham/sonic-mgmt that referenced this pull request May 30, 2025
…t for testNeighborMacNoPtf (sonic-net#251)

<!--
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.
-->
In testNeighborMacNoPtf test the bgp is disabled and checks that there are no routes installed by BGP in ASIC_DB
 by filtering out all local routes installed on testbed. For voq chassis, this collection of local routes was not including voq inband routes which mislead the correct summation of local routes on voq chassis.

Summary:
Fixes # (issue)
Added the voq inband ip routes in summation of all local routes
### 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
- [x] Test case improvement

### Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [x] 202411

### Approach
#### What is the motivation for this PR?
Test case failure for single_dut_multi_asic chasiss
#### How did you do it?

#### 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
576f835 [component] Fix typo for FW_AUTO_ERR_UNKNOWN sonic-net#254
5985388 Add recycle port to the physical ignore list (sonic-net#251)
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.

4 participants