Page MenuHomeVyOS Platform

Section config overlapped match with FRRConfig
Closed, ResolvedPublicBUG

Description

smoke test configd exit with fail, when we use "FRRConfig" in protorocols_x.py scripts because it finds 2 times "Config"
for example

def apply(isis):
    frr_cfg = frr.FRRConfig()

Test:

root@r12:/home/vyos# /usr/libexec/vyos/tests/smoke/cli/test_configd_inspect.py
.FF.
======================================================================
FAIL: test_file_instance (__main__.TestConfigdInclude)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/libexec/vyos/tests/smoke/cli/test_configd_inspect.py", line 46, in decorated_function
    f(*args, **kwargs)
  File "/usr/libexec/vyos/tests/smoke/cli/test_configd_inspect.py", line 96, in test_file_instance
    f"'{s}' more than one instance of Config")
AssertionError: 2 != 1 : 'protocols_isis.py' more than one instance of Config

======================================================================
FAIL: test_function_instance (__main__.TestConfigdInclude)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/libexec/vyos/tests/smoke/cli/test_configd_inspect.py", line 46, in decorated_function
    f(*args, **kwargs)
  File "/usr/libexec/vyos/tests/smoke/cli/test_configd_inspect.py", line 87, in test_function_instance
    f"'{s}': '{i}' instance of Config")
AssertionError: 1 != 0 : 'protocols_isis.py': 'apply' instance of Config

----------------------------------------------------------------------
Ran 4 tests in 0.580s

FAILED (failures=2)
root@r12:/home/vyos#

https://github.com/vyos/vyos-1x/blob/current/smoketest/scripts/cli/test_configd_inspect.py#L94
https://github.com/vyos/vyos-1x/blob/a0f115fb4304e29c38cb74d3be4969aa8136ae9d/python/vyos/frr.py#L368
https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/protocols_isis.py#L107

Details

Difficulty level
Unknown (require assessment)
Version
1.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

To clarify the fault here. the smoketest is looking for the word "Config()" inside all conf_mode scripts without taking into account that this could be part of another name. the patch above modifies the behavior to not mat when a alpha-character is in front of the C in Config.
full regex: [^a-ZA-Z]Config\(\)

Viacheslav claimed this task.
erkin renamed this task from Section Config overlapped match with FRRConfig to Section config overlapped match with FRRConfig.Aug 29 2021, 12:07 PM
erkin set Issue type to Internal change (not visible to end users).
erkin removed a subscriber: Active contributors.