diff --git a/scripts/featured b/scripts/featured index 6d48700d..2b9da970 100644 --- a/scripts/featured +++ b/scripts/featured @@ -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: diff --git a/tests/featured/featured_test.py b/tests/featured/featured_test.py index d893f68a..06400790 100644 --- a/tests/featured/featured_test.py +++ b/tests/featured/featured_test.py @@ -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]) diff --git a/tests/featured/test_vectors.py b/tests/featured/test_vectors.py index 1a5552b2..5f0a7b5a 100644 --- a/tests/featured/test_vectors.py +++ b/tests/featured/test_vectors.py @@ -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', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'teamd@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'teamd@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'teamd@1.service'], 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', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'macsec@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'macsec@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'macsec@1.service'], 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') + }, + }, ] ]