[featured] Changes for additional SpineRouter roles #240
Azure Pipelines / sonic-net.sonic-host-services
failed
Apr 17, 2025 in 7m 52s
Build #20250417.1 had test failures
Details
- Failed: 2 (0.73%)
- Passed: 273 (99.27%)
- Other: 0 (0.00%)
- Total: 275
Annotations
Check failure on line 618 in Build log
azure-pipelines / sonic-net.sonic-host-services
Build log #L618
Bash exited with code '1'.
Check failure on line 19 in Build log
azure-pipelines / sonic-net.sonic-host-services
Build log #L19
There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
Check failure on line 1 in test_handler_11_Disaggregated_Chassis_VOQ_multiasic
azure-pipelines / sonic-net.sonic-host-services
test_handler_11_Disaggregated_Chassis_VOQ_multiasic
AssertionError: 'run' does not contain all of (call(['sudo', 'systemctl', 'mask', 'lldp.service'], capture_output=True, check=True, text=True), call(['sudo', 'systemctl', 'disable', 'lldp.service'], capture_output=True, check=True, text=True), call(['sudo', 'systemctl', 'stop', 'lldp.service'], capture_output=True, check=True, text=True)) in its call list, found [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'stop', 'bgp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'disable', 'bgp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'mask', 'bgp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'stop', 'teamd.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'disable', 'teamd.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'mask', 'teamd.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'unmask', 'lldp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'enable', 'lldp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'start', 'lldp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'stop', 'macsec.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'disable', 'macsec.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'mask', 'macsec.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True),
Raw output
a = (<s.tests.featured.featured_test.TestFeatureHandler testMethod=test_handler_11_Disaggregated_Chassis_VOQ_multiasic>,)
@wraps(func)
def standalone_func(*a):
> return func(*(a + p.args), **p.kwargs)
/usr/lib/python3/dist-packages/parameterized/parameterized.py:637:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.11/dist-packages/pyfakefs/fake_filesystem_unittest.py:176: in wrapped
return f(*args, **kwargs)
tests/featured/featured_test.py:230: in test_handler
mocked_subprocess.run.assert_has_calls(config_data['enable_feature_subprocess_calls'],
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='subprocess.run' id='140654109732752'>
calls = [call(['sudo', 'systemctl', 'unmask', 'bgp@0.service'], capture_output=True, check=True, text=True), call(['sudo', 'sy...ue, text=True), call(['sudo', 'systemctl', 'start', 'bgp@1.service'], capture_output=True, check=True, text=True), ...]
any_order = True
def assert_has_calls(self, calls, any_order=False):
"""assert the mock has been called with the specified calls.
The `mock_calls` list is checked for the calls.
If `any_order` is False (the default) then the calls must be
sequential. There can be extra calls before or after the
specified calls.
If `any_order` is True then the calls can be in any order, but
they must all appear in `mock_calls`."""
expected = [self._call_matcher(c) for c in calls]
cause = next((e for e in expected if isinstance(e, Exception)), None)
all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
if not any_order:
if expected not in all_calls:
if cause is None:
problem = 'Calls not found.'
else:
problem = ('Error processing expected calls.\n'
'Errors: {}').format(
[e if isinstance(e, Exception) else None
for e in expected])
raise AssertionError(
f'{problem}\n'
f'Expected: {_CallList(calls)}'
f'{self._calls_repr(prefix="Actual").rstrip(".")}'
) from cause
return
all_calls = list(all_calls)
not_found = []
for kall in expected:
try:
all_calls.remove(kall)
except ValueError:
not_found.append(kall)
if not_found:
> raise AssertionError(
'%r does not contain all of %r in its call list, '
'found %r instead' % (self._mock_name or 'mock',
tuple(not_found), all_calls)
) from cause
E AssertionError: 'run' does not contain all of (call(['sudo', 'systemctl', 'mask', 'lldp.service'], capture_output=True, check=True, text=True), call(['sudo', 'systemctl', 'disable', 'lldp.service'], capture_output=True, check=True, text=True), call(['sudo', 'systemctl', 'stop', 'lldp.service'], capture_output=True, check=True, text=True)) in its call list, found [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'stop', 'bgp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().stderr.__str__(), call(['sudo', 'systemctl', 'disable', 'bgp.service'], capture_output=True, check=True, text=True), call().stdout.__str__(), call().st
Check failure on line 1 in test_sync_state_field_11_Disaggregated_Chassis_VOQ_multiasic
azure-pipelines / sonic-net.sonic-host-services
test_sync_state_field_11_Disaggregated_Chassis_VOQ_multiasic
AssertionError: 'FEATURE' table in 'CONFIG_DB' is modified unexpectedly!
assert False
Raw output
a = (<s.tests.featured.featured_test.TestFeatureHandler testMethod=test_sync_state_field_11_Disaggregated_Chassis_VOQ_multiasic>,)
@wraps(func)
def standalone_func(*a):
> return func(*(a + p.args), **p.kwargs)
/usr/lib/python3/dist-packages/parameterized/parameterized.py:637:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.11/dist-packages/pyfakefs/fake_filesystem_unittest.py:176: in wrapped
return f(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <s.tests.featured.featured_test.TestFeatureHandler testMethod=test_sync_state_field_11_Disaggregated_Chassis_VOQ_multiasic>
test_scenario_name = 'Disaggregated_Chassis_VOQ_multiasic'
config_data = {'config_db': {'DEVICE_METADATA': {'localhost': {'type': 'UpperSpineRouter'}}, 'FEATURE': {'bgp': {'auto_restart': 'en...xt=True), call(['sudo', 'systemctl', 'start', 'bgp@1.service'], capture_output=True, check=True, text=True), ...], ...}
fs = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7fec967c3890>
@parameterized.expand(FEATURED_TEST_VECTOR)
@patchfs
def test_sync_state_field(self, test_scenario_name, config_data, fs):
"""Tests the method `sync_state_field(...)` of `FeatureHandler` class.
Args:
test_secnario_name: A string indicates different testing scenario.
config_data: A dictionary contains initial `CONFIG_DB` tables and expected results.
Returns:
Boolean value indicates whether test will pass or not.
"""
# add real path of sesscommon for database_config.json
fs.add_real_paths(swsscommon_package.__path__)
fs.create_dir(featured.FeatureHandler.SYSTEMD_SYSTEM_DIR)
MockConfigDb.set_config_db(config_data['config_db'])
feature_state_table_mock = mock.Mock()
with mock.patch('featured.subprocess') as mocked_subprocess:
with mock.patch("sonic_py_common.device_info.get_device_runtime_metadata", return_value=config_data['device_runtime_metadata']):
with mock.patch("sonic_py_common.device_info.is_multi_npu", return_value=True if 'num_npu' in config_data else False):
with mock.patch("sonic_py_common.device_info.get_num_npus", return_value=config_data['num_npu'] if 'num_npu' in config_data else 1):
with mock.patch("sonic_py_common.device_info.get_namespaces", return_value=["asic{}".format(a) for a in range(config_data['num_npu'])] if 'num_npu' in config_data else []):
popen_mock = mock.Mock()
attrs = config_data['popen_attributes']
popen_mock.configure_mock(**attrs)
mocked_subprocess.Popen.return_value = popen_mock
device_config = {}
device_config['DEVICE_METADATA'] = MockConfigDb.CONFIG_DB['DEVICE_METADATA']
device_config.update(config_data['device_runtime_metadata'])
device_type = MockConfigDb.CONFIG_DB['DEVICE_METADATA']['localhost']['type']
feature_handler = featured.FeatureHandler(MockConfigDb(), feature_state_table_mock,
device_config, False)
feature_handler.is_delayed_enabled = True
feature_table = MockConfigDb.CONFIG_DB['FEATURE']
feature_handler.sync_state_field(feature_table)
feature_systemd_name_map = {}
for feature_name in feature_table.keys():
feature = featured.Feature(feature_name, feature_table[feature_name], device_config)
feature_names, _ = feature_handler.get_multiasic_feature_instances(featu
Loading