Skip to content

[bgp] test_bgp_speaker_announce_routes fails #8096

@theasianpianist

Description

@theasianpianist
common_setup_teardown = (u'10.64.246.139', {'deployment_id': u'1', 'dhcp_servers': [u'192.0.0.1', u'192.0.0.2', u'192.0.0.3', u'192.0.0.4', u'....4/21')], [IPNetwork('fc02:1000::2/64'), IPNetwork('fc02:1000::3/64'), IPNetwork('fc02:1000::4/64')], u'Vlan1000', ...)
tbinfo = {'auto_recover': 'True', 'comment': 'hellogemini', 'conf-name': 'vms17-dual-t0-7050-1', 'duts': ['str2-7050cx3-acs-06', 'str2-7050cx3-acs-07'], ...}
duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7fb445859110>
rand_one_dut_hostname = 'str2-7050cx3-acs-07'
ptfhost = <tests.common.devices.ptf.PTFHost object at 0x7fb43f136290>
ipv4 = True, ipv6 = False, mtu = 1514, vlan_mac = u'00:aa:bb:cc:dd:ee'

    @pytest.mark.parametrize("ipv4, ipv6, mtu", [pytest.param(True, False, 1514)])
    def test_bgp_speaker_announce_routes(common_setup_teardown, tbinfo, duthosts, rand_one_dut_hostname, ptfhost, ipv4, ipv6, mtu, vlan_mac):
        """Setup bgp speaker on T0 topology and verify routes advertised by bgp speaker is received by T0 TOR
    
        """
        duthost = duthosts[rand_one_dut_hostname]
        nexthops = common_setup_teardown[3]
>       bgp_speaker_announce_routes_common(common_setup_teardown, tbinfo, duthost, ptfhost, ipv4, ipv6, mtu, "v4", "10.10.10.0/26", nexthops, vlan_mac)

common_setup_teardown = (u'10.64.246.139', {'deployment_id': u'1', 'dhcp_servers': [u'192.0.0.1', u'192.0.0.2', u'192.0.0.3', u'192.0.0.4', u'....4/21')], [IPNetwork('fc02:1000::2/64'), IPNetwork('fc02:1000::3/64'), IPNetwork('fc02:1000::4/64')], u'Vlan1000', ...)
duthost    = <MultiAsicSonicHost> str2-7050cx3-acs-07
duthosts   = <tests.common.devices.duthosts.DutHosts object at 0x7fb445859110>
ipv4       = True
ipv6       = False
mtu        = 1514
nexthops   = [IPNetwork('192.168.0.2/21'), IPNetwork('192.168.0.3/21'), IPNetwork('192.168.0.4/21')]
ptfhost    = <tests.common.devices.ptf.PTFHost object at 0x7fb43f136290>
rand_one_dut_hostname = 'str2-7050cx3-acs-07'
tbinfo     = {'auto_recover': 'True', 'comment': 'hellogemini', 'conf-name': 'vms17-dual-t0-7050-1', 'duts': ['str2-7050cx3-acs-06', 'str2-7050cx3-acs-07'], ...}
vlan_mac   = u'00:aa:bb:cc:dd:ee'

bgp/test_bgp_speaker.py:322: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
bgp/test_bgp_speaker.py:305: in bgp_speaker_announce_routes_common
    socket_recv_size=16384)
ptf_runner.py:41: in ptf_runner
    result = host.shell(cmd, chdir="/root", module_ignore_errors=module_ignore_errors)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.common.devices.ptf.PTFHost object at 0x7fb43f136290>
module_args = ('ptf --test-dir ptftests fib_test.FibTest --platform-dir ptftests --platform remote -t \'router_macs=[u\'"\'"\'d4:af:...t_port_map.json\'"\'"\'\' --relax --debug info --log-file /tmp/bgp_speaker_test.FibTest.log --socket-recv-size 16384',)
complex_args = {'chdir': '/root'}
previous_frame = <frame object at 0x5581bf72e490>
filename = '/var/sonicbld/workspace/NewTests/TEMPLATE_PYTEST_T0_DUALTOR-7050/tests/ptf_runner.py'
line_number = 41, function_name = 'ptf_runner'
lines = ['    result = host.shell(cmd, chdir="/root", module_ignore_errors=module_ignore_errors)\n']
index = 0, verbose = True, module_ignore_errors = False, module_async = False

    def _run(self, *module_args, **complex_args):
    
        previous_frame = inspect.currentframe().f_back
        filename, line_number, function_name, lines, index = inspect.getframeinfo(previous_frame)
    
        verbose = complex_args.pop('verbose', True)
    
        if verbose:
            logging.debug("{}::{}#{}: [{}] AnsibleModule::{}, args={}, kwargs={}"\
                .format(filename, function_name, line_number, self.hostname,
                        self.module_name, json.dumps(module_args), json.dumps(complex_args)))
        else:
            logging.debug("{}::{}#{}: [{}] AnsibleModule::{} executing..."\
                .format(filename, function_name, line_number, self.hostname, self.module_name))
    
        module_ignore_errors = complex_args.pop('module_ignore_errors', False)
        module_async = complex_args.pop('module_async', False)
    
        if module_async:
            def run_module(module_args, complex_args):
                return self.module(*module_args, **complex_args)[self.hostname]
            pool = ThreadPool()
            result = pool.apply_async(run_module, (module_args, complex_args))
            return pool, result
    
        res = self.module(*module_args, **complex_args)[self.hostname]
    
        if verbose:
            logging.debug("{}::{}#{}: [{}] AnsibleModule::{} Result => {}"\
                .format(filename, function_name, line_number, self.hostname, self.module_name, json.dumps(res)))
        else:
            logging.debug("{}::{}#{}: [{}] AnsibleModule::{} done, is_failed={}, rc={}"\
                .format(filename, function_name, line_number, self.hostname, self.module_name, \
                        res.is_failed, res.get('rc', None)))
    
        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 shell failed, Ansible Results =>
E           {
E               "changed": true, 
E               "cmd": "ptf --test-dir ptftests fib_test.FibTest --platform-dir ptftests --platform remote -t 'router_macs=[u'\"'\"'d4:af:f7:4d:af:18'\"'\"'];testbed_mtu=1514;ipv4=True;ipv6=False;fib_info_files=['\"'\"'/root/bgp_speaker_route_v4.txt'\"'\"'];test_balancing=False;ptf_test_port_map='\"'\"'/root/ptf_test_port_map.json'\"'\"'' --relax --debug info --log-file /tmp/bgp_speaker_test.FibTest.log --socket-recv-size 16384", 
E               "delta": "0:00:01.751917", 
E               "end": "2021-07-06 06:05:19.431706", 
E               "failed": true, 
E               "invocation": {
E                   "module_args": {
E                       "_raw_params": "ptf --test-dir ptftests fib_test.FibTest --platform-dir ptftests --platform remote -t 'router_macs=[u'\"'\"'d4:af:f7:4d:af:18'\"'\"'];testbed_mtu=1514;ipv4=True;ipv6=False;fib_info_files=['\"'\"'/root/bgp_speaker_route_v4.txt'\"'\"'];test_balancing=False;ptf_test_port_map='\"'\"'/root/ptf_test_port_map.json'\"'\"'' --relax --debug info --log-file /tmp/bgp_speaker_test.FibTest.log --socket-recv-size 16384", 
E                       "_uses_shell": true, 
E                       "argv": null, 
E                       "chdir": "/root", 
E                       "creates": null, 
E                       "executable": null, 
E                       "removes": null, 
E                       "stdin": null, 
E                       "stdin_add_newline": true, 
E                       "strip_empty_ends": true, 
E                       "warn": true
E                   }
E               }, 
E               "msg": "non-zero return code", 
E               "rc": 1, 
E               "start": "2021-07-06 06:05:17.679789", 
E               "stderr": "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.\n  from cryptography.hazmat.backends import default_backend\nfib_test.FibTest ... ERROR\n\n======================================================================\nERROR: fib_test.FibTest\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"ptftests/fib_test.py\", line 429, in runTest\n    self.check_ip_ranges()\n  File \"ptftests/fib_test.py\", line 154, in check_ip_ranges\n    self.check_ip_range(ip_range, dut_index, ipv4)\n  File \"ptftests/fib_test.py\", line 189, in check_ip_range\n    self.check_ip_route(src_port, dst_ip, exp_ports, ipv4)\n  File \"ptftests/fib_test.py\", line 214, in check_ip_route\n    res = self.check_ipv4_route(src_port, dst_ip_addr, dst_port_list)\n  File \"ptftests/fib_test.py\", line 302, in check_ipv4_route\n    format(ip_src, ip_dst, src_port, dst_port_list[rcvd_port], exp_src_mac, actual_src_mac))\nException: Pkt sent from 30.0.0.1 to 10.10.10.0 on port 33 was rcvd pkt on 1 which is one of the expected ports, but the src mac doesn't match, expected d4:af:f7:4d:af:18, got 00:aa:bb:cc:dd:ee\n\n----------------------------------------------------------------------\nRan 1 test in 0.089s\n\nFAILED (errors=1)", 
E               "stderr_lines": [
E                   "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.", 
E                   "  from cryptography.hazmat.backends import default_backend", 
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 429, in runTest", 
E                   "    self.check_ip_ranges()", 
E                   "  File \"ptftests/fib_test.py\", line 154, in check_ip_ranges", 
E                   "    self.check_ip_range(ip_range, dut_index, ipv4)", 
E                   "  File \"ptftests/fib_test.py\", line 189, in check_ip_range", 
E                   "    self.check_ip_route(src_port, dst_ip, exp_ports, ipv4)", 
E                   "  File \"ptftests/fib_test.py\", line 214, in check_ip_route", 
E                   "    res = self.check_ipv4_route(src_port, dst_ip_addr, dst_port_list)", 
E                   "  File \"ptftests/fib_test.py\", line 302, in check_ipv4_route", 
E                   "    format(ip_src, ip_dst, src_port, dst_port_list[rcvd_port], exp_src_mac, actual_src_mac))", 
E                   "Exception: Pkt sent from 30.0.0.1 to 10.10.10.0 on port 33 was rcvd pkt on 1 which is one of the expected ports, but the src mac doesn't match, expected d4:af:f7:4d:af:18, got 00:aa:bb:cc:dd:ee", 
E                   "", 
E                   "----------------------------------------------------------------------", 
E                   "Ran 1 test in 0.089s", 
E                   "", 
E                   "FAILED (errors=1)"
E               ], 
E               "stdout": "", 
E               "stdout_lines": []
E           }

complex_args = {'chdir': '/root'}
filename   = '/var/sonicbld/workspace/NewTests/TEMPLATE_PYTEST_T0_DUALTOR-7050/tests/ptf_runner.py'
function_name = 'ptf_runner'
index      = 0
line_number = 41
lines      = ['    result = host.shell(cmd, chdir="/root", module_ignore_errors=module_ignore_errors)\n']
module_args = ('ptf --test-dir ptftests fib_test.FibTest --platform-dir ptftests --platform remote -t \'router_macs=[u\'"\'"\'d4:af:...t_port_map.json\'"\'"\'\' --relax --debug info --log-file /tmp/bgp_speaker_test.FibTest.log --socket-recv-size 16384',)
module_async = False
module_ignore_errors = False
previous_frame = <frame object at 0x5581bf72e490>
res        = {'stderr_lines': [u'/usr/local/lib/python2.7/dist-packages/paramiko/transport....: [], u'start': u'2021-07-06 06:05:17.679789', u'msg': u'non-zero return code'}
self       = <tests.common.devices.ptf.PTFHost object at 0x7fb43f136290>
verbose    = True

common/devices/base.py:89: RunAnsibleModuleFail

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions