Skip to content

test_link_flap.py::Failed to authenticate: Authentication failed #2180

@stephengzh

Description

@stephengzh

Hi,

I was trying to execute the script test_link_flap.py, an error happened. I cannot understand the error. Anyone help me?

=========================================================================================== test session starts ===========================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1
ansible: 2.8.7
rootdir: /var/johnar/sonic-mgmt/tests, inifile: pytest.ini
plugins: repeat-0.8.0, xdist-1.28.0, ansible-2.2.2, forked-1.1.3
collected 1 item                                                                                                                                                                                          

platform_tests/test_link_flap.py Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
F                                                                                                                                                                  [100%]

================================================================================================ FAILURES =================================================================================================
_____________________________________________________________________________________________ test_link_flap ______________________________________________________________________________________________

request = <FixtureRequest for <Function test_link_flap>>, duthost = <tests.common.devices.SonicHost object at 0x7f9288f4a110>
fanouthosts = {u'str-7260-10': { os: 'eos', hostname: 'str-7260-10', device_type: 'FanoutLeaf' }}

    @pytest.mark.platform('physical')
    def test_link_flap(request, duthost, fanouthosts):
        normalized_level = [mark.args for mark in request.node.iter_markers(name="supported_completeness_level")][0]
        logging.info("Completeness level set: {}".format(str(normalized_level)))
        tlf = TestLinkFlap()
>       tlf.run_link_flap_test(duthost, fanouthosts, normalized_level)

platform_tests/test_link_flap.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
platform_tests/test_link_flap.py:84: in run_link_flap_test
    fanout.no_shutdown(fanout_port)
common/devices.py:1205: in no_shutdown
    return self.host.no_shutdown(interface_name)
common/devices.py:968: in no_shutdown
    parents='interface %s' % interface_name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tests.common.devices.EosHost object at 0x7f9287c3b650>, module_args = (), complex_args = {'lines': ['no shutdown'], 'parents': 'interface TFGigabitEthernet 0/8'}
previous_frame = <frame object at 0x7f92800039b0>, filename = '/var/johnar/sonic-mgmt/tests/common/devices.py', line_number = 968, function_name = 'no_shutdown'
lines = ["            parents='interface %s' % interface_name)\n"], index = 0, 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)
    
        logging.debug("{}::{}#{}: [{}] AnsibleModule::{}, args={}, kwargs={}"\
            .format(filename, function_name, line_number, self.hostname,
                    self.module_name, json.dumps(module_args), json.dumps(complex_args)))
    
        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]
        logging.debug("{}::{}#{}: [{}] AnsibleModule::{} Result => {}"\
            .format(filename, function_name, line_number, self.hostname, self.module_name, json.dumps(res)))
    
        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 eos_config failed, Ansible Results =>
E           {
E               "failed": true, 
E               "msg": "Failed to authenticate: Authentication failed."
E           }

common/devices.py:88: RunAnsibleModuleFail
======================================================================================== 1 failed in 16.36 seconds ========================================================================================
johnar@6dc8f31ae7dd:~/sonic-mgmt/tests$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions