Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/featured
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class FeatureHandler(object):

device_type = self._device_config.get('DEVICE_METADATA', {}).get('localhost', {}).get('type')
is_dependent_service = feature_config.name in ['syncd', 'gbsyncd']
if device_type == 'SpineRouter' and is_dependent_service:
if device_type in ['SpineRouter', 'UpperSpineRouter', 'FabricSpineRouter'] and is_dependent_service:
syslog.syslog(syslog.LOG_INFO, "Skipped setting Restart field in systemd for {}".format(feature_config.name))
restart_field_str = "no"
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/featured/featured_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def checks_systemd_config_file(self, device_type, feature_table, feature_systemd

with open(feature_systemd_config_file_path) as systemd_config_file:
status = systemd_config_file.read().strip()
if device_type == 'SpineRouter' and is_dependent_feature:
if device_type in ['SpineRouter', 'UpperSpineRouter', 'FabricSpineRouter'] and is_dependent_feature:
assert status == '[Service]\nRestart=no'
else:
assert status == '[Service]\nRestart={}'.format(truth_table[auto_restart_status])
Expand Down
140 changes: 140 additions & 0 deletions tests/featured/test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,146 @@
'communicate.return_value': ('output', 'error')
},
},
],
[
"Disaggregated_Chassis_VOQ_multiasic",
{
"num_npu": 2,
"device_runtime_metadata": {
"DEVICE_RUNTIME_METADATA": {
"ETHERNET_PORTS_PRESENT":True,
"MACSEC_SUPPORTED":True
}
},
"config_db": {
"DEVICE_METADATA": {
"localhost": {
"type": "UpperSpineRouter",
}
},
"FEATURE": {
"bgp": {
"state": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}",
"delayed": "False",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
},
"teamd": {
"state": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] %}disabled{% else %}enabled{% endif %}",
"delayed": "False",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
},
"lldp": {
"state": "enabled",
"delayed": "False",
"has_global_scope": "{% if ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['linecard']) %}False{% else %}True{% endif %}",
"has_per_asic_scope": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
},
"macsec": {
"state": "{% if DEVICE_RUNTIME_METADATA['MACSEC_SUPPORTED'] %}enabled{% else %}disabled{% endif %}",
"delayed": "False",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
},
"pmon": {
"state": "enabled",
"delayed": "{% if 'type' in DEVICE_METADATA['localhost'] and 'SpineRouter' in DEVICE_METADATA['localhost']['type'] %}False{% else %}True{% endif %}",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
}
},
},
"expected_config_db": {
"FEATURE": {
"bgp": {
"auto_restart": "enabled",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"delayed": "False",
"high_mem_alert": "disabled",
"state": "enabled"
},
"teamd": {
"auto_restart": "enabled",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"delayed": "False",
"high_mem_alert": "disabled",
"state": "enabled"
},
"lldp": {
"auto_restart": "enabled",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"delayed": "False",
"high_mem_alert": "disabled",
"state": "enabled"
},
"macsec": {
"auto_restart": "enabled",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"delayed": "False",
"high_mem_alert": "disabled",
"state": "enabled"
},
"pmon": {
"auto_restart": "enabled",
"has_global_scope": "False",
"has_per_asic_scope": "True",
"delayed": "False",
"high_mem_alert": "disabled",
"state": "enabled"
}
},
},
"enable_feature_subprocess_calls": [
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
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),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'unmask', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'enable', '[email protected]'], capture_output=True, check=True, text=True),
call(['sudo', 'systemctl', 'start', '[email protected]'], capture_output=True, check=True, text=True)
],
"daemon_reload_subprocess_call": [
call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True),
],
"popen_attributes": {
'communicate.return_value': ('output', 'error')
},
},
]
]

Expand Down
Loading