Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong DIP on packet #1171

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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