Skip to content

Commit

Permalink
Wrong DIP on packet (#1171)
Browse files Browse the repository at this point in the history
* wrong DIP on packet

it cannot receive BGP, SNMP, SSH IP2ME packet on t1-lag and the root cause is copp_test.py config wrong DIP on packet

* fix comment indentation

Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
  • Loading branch information
crzas and yxieca committed Jul 9, 2020
1 parent 5cb4aaf commit 0446377
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ansible/roles/test/files/ptftests/copp_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@ def __init__(self):

self.timeout_thr = None

self.minig_bgp = test_params.get('minig_bgp', None)
idx = 0
self.myip = {}
self.peerip = {}
for i in xrange(self.MAX_PORTS):
self.myip[i] = "10.0.0.%d" % (i*2+1)
self.peerip[i] = "10.0.0.%d" % (i*2)


for peer in self.minig_bgp:
if str(peer['peer_addr']).find('10.0.0') == 0:#filter IPv6 info.
self.myip[idx] = peer['addr']
self.peerip[idx] = peer['peer_addr']
idx = idx+1
#if port number is out of the total of IPv4, take the last IPv4
if int(target_port_str) > idx-1:
self.myip[self.target_port] = self.myip[idx-1]
self.peerip[self.target_port] = self.peerip[idx-1]

return

def log(self, message, debug=False):
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/test/tasks/copp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
- verbose=False
- pkt_tx_count={{ pkt_tx_count|default(0) }}
- target_port={{ nn_target_port }}
- minig_bgp={{ minigraph_bgp }}
ptf_extra_options: "--device-socket 0-{{ nn_target_port }}@tcp://127.0.0.1:10900 --device-socket 1-{{ nn_target_port }}@tcp://{{ ansible_eth0['ipv4']['address'] }}:10900"
with_items:
- ARPTest
Expand Down

0 comments on commit 0446377

Please sign in to comment.