Skip to content

Add a test to check ipv6 routes over ipv4 bgp session#1944

Merged
pavel-shirshov merged 23 commits intosonic-net:masterfrom
pavel-shirshov:pavelsh/ipv6_ipv4_test
Aug 11, 2020
Merged

Add a test to check ipv6 routes over ipv4 bgp session#1944
pavel-shirshov merged 23 commits intosonic-net:masterfrom
pavel-shirshov:pavelsh/ipv6_ipv4_test

Conversation

@pavel-shirshov
Copy link
Contributor

@pavel-shirshov pavel-shirshov commented Jul 21, 2020

Description of PR

Summary: Added a new testcase to check ipv6 routes, received over dynamic ipv4 bgp session. This test is required to check sonic-net/sonic-quagga#42

Type of change

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

Approach

What is the motivation for this PR?

Recently we found a bug in sonic-quagga. We need to test sonic after the bug fix sonic-net/sonic-quagga#42.

How did you do it?

I used existing ipv4 bgp speaker test as an example. I added ipv6 test case and also fixed some issues in the common test functions:

  • add support of the older sonic release
  • generate_ips() wasn't able generage ips for the ipv6 prefixes
  • fix bugs in exabgp ansible module. Otherwise I got
    @summary: Class for PTF
        if (res.is_failed or 'exception' in res) and not module_ignore_errors:
>           raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)
E           RunAnsibleModuleFail: run module exabgp failed, Ansible Results =>
E           {
E               "changed": false, 
E               "invocation": {
E                   "module_args": {
E                       "local_asn": null, 
E                       "local_ip": null, 
E                       "name": "bgps0", 
E                       "peer_asn": null, 
E                       "peer_ip": null, 
E                       "port": 5000, 
E                       "router_id": null, 
E                       "state": "absent"
E                   }
E               }, 
E               "msg": "Error: (<type 'exceptions.NameError'>, NameError(\"global name 'e' is not defined\",), <traceback object at 0x7f59d6178c20>)"
E           }

common/devices.py:82: RunAnsibleModuleFail
  • fib_test.py uses fib.py and lpm.py which didn't work for ipv6
E               "stderr_lines": [
E                   "fib_test.FibTest ... ERROR", 
E                   "", 
E                   "======================================================================", 
E                   "ERROR: fib_test.FibTest", 
E                   "----------------------------------------------------------------------", 
E                   "Traceback (most recent call last):", 
E                   "  File \"ptftests/fib_test.py\", line 353, in runTest", 
E                   "    self.check_ip_ranges(ipv4=False)", 
E                   "  File \"ptftests/fib_test.py\", line 152, in check_ip_ranges", 
E                   "    next_hop = self.fib[ip_range.get_first_ip()]", 
E                   "  File \"ptftests/fib.py\", line 73, in __getitem__", 
E                   "    return self._ipv6_lpm_dict[str(ip)]", 
E                   "  File \"ptftests/lpm.py\", line 77, in __getitem__", 
E                   "    return self._subnet_tree[key]", 
E                   "  File \"/usr/local/lib/python2.7/dist-packages/SubnetTree.py\", line 157, in __getitem__", 
E                   "    return _SubnetTree.SubnetTree___getitem__(self, cidr)", 
E                   "KeyError: '::2'", 
E                   "", 
E                   "----------------------------------------------------------------------", 
E                   "Ran 1 test in 0.009s", 
E                   "", 
E                   "FAILED (errors=1)"
E               ], 
E               "stdout": "", 
E               "stdout_lines": []
E           }

How did you verify/test it?

I used following line:

cd tests
pytest bgp/test_bgp_speaker.py --testbed=vms3-t0-s6100 --inventory=../ansible/str --testbed_file=../ansible/testbed.csv --host-pattern=vms3-t0-s6100 --module-path=../ansible/library --disable_loganalyzer

Result

root@69a3478e5869:~/sonic-mgmt/tests# pytest bgp/test_bgp_speaker.py --testbed=vms3-t0-s6100 --inventory=../ansible/str --testbed_file=../ansible/testbed.csv --host-pattern=vms3-t0-s6100 --module-path=../ansible/library --disable_loganalyzer
============================================= test session starts ==============================================
platform linux2 -- Python 2.7.12, pytest-4.6.9, py-1.8.1, pluggy-0.13.1
ansible: 2.8.7
rootdir: /var/johnar/Networking-acs-sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.2.2
collected 3 items                                                                                              

bgp/test_bgp_speaker.py ...                                                                              [100%]

========================================== 3 passed in 257.53 seconds ==========================================

Any platform specific information?

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

This test support t0 topology.

Documentation

@pavel-shirshov pavel-shirshov requested a review from lguohan July 21, 2020 20:26
@pavel-shirshov pavel-shirshov self-assigned this Jul 21, 2020
@lgtm-com
Copy link

lgtm-com bot commented Jul 21, 2020

This pull request introduces 1 alert when merging 8b9830c into 009983d - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Jul 21, 2020

This pull request introduces 1 alert when merging 487b272 into 009983d - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lguohan
Copy link
Contributor

lguohan commented Jul 22, 2020

can you check the test cases failure?

@pavel-shirshov
Copy link
Contributor Author

@lguohan. I have to add ipv6 prefix for loopback in the minigraph generation. I totally forgot. I'll fix tomorrow.

@lgtm-com
Copy link

lgtm-com bot commented Aug 4, 2020

This pull request introduces 1 alert when merging 06d2f22 into 0805536 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lguohan
Copy link
Contributor

lguohan commented Aug 4, 2020

can you check the test failure?

@pavel-shirshov
Copy link
Contributor Author

@lguohan
The test failure because the test couldn't find ipv6 address on the vlan interface

23:09:11          # Generate ipv6 nexthops
23:09:11  >       vlan_ipv6_entry = mg_facts['minigraph_vlan_interfaces'][1]
23:09:11  E       IndexError: list index out of range

It looks like this PR #1982 is not used in the test.

@lgtm-com
Copy link

lgtm-com bot commented Aug 4, 2020

This pull request introduces 1 alert when merging 91878db into f5d9eaa - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 4, 2020

This pull request fixes 1 alert when merging b65f811 into 94c9904 - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 5, 2020

This pull request fixes 1 alert when merging 97d24b8 into 9da74ca - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@pavel-shirshov
Copy link
Contributor Author

retest this please

@lgtm-com
Copy link

lgtm-com bot commented Aug 6, 2020

This pull request fixes 1 alert when merging 9271bf0 into bf49ff0 - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 7, 2020

This pull request fixes 1 alert when merging 6b6eaeb into 16b4469 - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2020

This pull request fixes 1 alert when merging 38f08c9 into 16b4469 - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@pavel-shirshov
Copy link
Contributor Author

retest this please

@lgtm-com
Copy link

lgtm-com bot commented Aug 10, 2020

This pull request fixes 1 alert when merging 34bbeec into 1e4bccc - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@pavel-shirshov pavel-shirshov merged commit 7b7872f into sonic-net:master Aug 11, 2020
@pavel-shirshov pavel-shirshov deleted the pavelsh/ipv6_ipv4_test branch August 11, 2020 03:46
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…rm-common] advance submodule head (sonic-net#12492)

linkmgrd:
* d7d6635 2022-10-21 | Fix link prober state event report twice issue (sonic-net#149) (HEAD -> 202205) [Longxiang Lyu]
* 0ef3296 2022-10-21 | [active-active] Add support to send/handle mux probe request (sonic-net#147) [Longxiang Lyu]
* a66fa34 2022-10-17 | [active-active] Fix config reload (sonic-net#145) [Longxiang Lyu]
* 7e1c820 2022-10-11 | [Active-Standby] avoid posting mux metrics event when receiving unsolicited mux state notification  (sonic-net#142) [Jing Zhang]
* 237cfd2 2022-10-07 | [Active-Active] Update default route shutdown heartbeat logic (sonic-net#141) [Jing Zhang]

utilities:
* 415d30e 2022-10-23 | [techsupport] Adding FRR EVPN dumps (sonic-net#2442) (HEAD -> 202205) [Sudharsan Dhamal Gopalarathnam]
* b3ffe45 2022-10-21 | [show][muxcable] add support for show mux firmware version all (sonic-net#2441) [vdahiya12]
* 7d68534 2022-10-19 | [app_ext] [auto-ts] Add available_mem_threshold option (sonic-net#2423) [Vivek]
* 52b9c16 2022-10-07 | [muxcable][config] add CLI support for mux mode detach (sonic-net#2425) [Jing Zhang]
* 14646ff 2022-10-10 | [show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' (sonic-net#2386) [Andriy Yurkiv]
* dffcc53 2022-10-11 | Add a subcommand to display a hexdump of transceiver EEPROM page (sonic-net#2379) [mihirpat1]
* 86175c2 2022-10-17 | [chassis]Add fabric counter cli commands (sonic-net#1860) [Maxime Lorrillere]

swss:
* 6fe0afd 2022-10-25 | [portsorch] remove port OID from saiOidToAlias map on port deletion (sonic-net#2483) (HEAD -> 202205, github/202205) [Stepan Blyshchak]
* 7290d66 2022-10-07 | [vlanmgr] Disable `arp_evict_nocarrier` for vlan host intf (sonic-net#2469) [Longxiang Lyu]
* d074001 2022-10-05 | [chassis][voq]Collect counters for fabric links (sonic-net#1944) [Maxime Lorrillere]
* 3a0353a 2022-10-18 | [counters][202205] Improve performance by polling only configured ports buffer queue/pg counters (sonic-net#2474) [Vadym Hlushko]
* 2feb39d 2022-10-14 | [202205] [crm] Fix issue with continues EXCEEDED and CLEAR logs for ACL group/table counters (sonic-net#2482) [Volodymyr Samotiy]

sairedis:
* 326b630 2022-10-21 | [gbsyncd] Add asic db prefix for channel NOTIFICATIONS (sonic-net#1129) (HEAD -> 202205) [Junhua Zhai]

platform-daemon:
* 6dbda9b 2022-10-25 | [ycabled] fix no port/state returned by grpc server (sonic-net#308) (HEAD -> 202205) [vdahiya12]
* 3d1228a 2022-10-20 | Fix xcvrd to support 400G ZR optic (sonic-net#293) [Bohan Yang]

platform-common:
* c04d710 2022-09-29 | Read CMIS data path state duration (sonic-net#312) (HEAD -> 202205) [Bohan Yang]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

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
  9514857 [config reload][202106] Update command reference (sonic-net#1944)
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.

2 participants