diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 2a2f6797af..48c9e19a78 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -124,7 +124,7 @@ jobs: make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz if [ $(Build.Reason) != 'PullRequest' ];then gzip -kd target/sonic-vs.img.gz - SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run + SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make $BUILD_OPTIONS sonic-slave-run rm target/sonic-vs.img fi else diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 2f31b5ded0..3e1a52e911 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -347,7 +347,7 @@ sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/restart_service sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install smartmontools=7.2-1 # Install custom-built openssh sshd -sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/openssh-server_${OPENSSH_VERSION}_*.deb +sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/openssh-server_${OPENSSH_VERSION}_*.deb $debs_path/openssh-client_${OPENSSH_VERSION}_*.deb $debs_path/openssh-sftp-server_${OPENSSH_VERSION}_*.deb {% if sonic_asic_platform == 'broadcom' %} # Install custom-built flashrom diff --git a/rules/openssh.mk b/rules/openssh.mk index a5e4b5c4b7..5609bf34e4 100644 --- a/rules/openssh.mk +++ b/rules/openssh.mk @@ -1,6 +1,6 @@ # openssh package -OPENSSH_VERSION = 8.4p1-5+deb11u1 +OPENSSH_VERSION = 8.4p1-5+deb11u2 export OPENSSH_VERSION @@ -9,6 +9,12 @@ $(OPENSSH_SERVER)_SRC_PATH = $(SRC_PATH)/openssh $(OPENSSH_SERVER)_DEPENDS += $(LIBNL3_DEV) $(LIBNL_ROUTE3_DEV) SONIC_MAKE_DEBS += $(OPENSSH_SERVER) +OPENSSH_CLIENT = openssh-client_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(OPENSSH_SERVER),$(OPENSSH_CLIENT))) + +OPENSSH_SFTP_SERVER = openssh-sftp-server_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(OPENSSH_SERVER),$(OPENSSH_SFTP_SERVER))) + # The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} # are archived into debug one image to facilitate debugging. # diff --git a/slave.mk b/slave.mk index 56ed0ef267..91f66c274e 100644 --- a/slave.mk +++ b/slave.mk @@ -658,7 +658,7 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) # we depend on it and move our deb to other targets # Add new dev package: # $(eval $(call add_derived_package,$(ORIGINAL_DEB),derived_deb_file.deb)) -$(addprefix $(DEBS_PATH)/, $(SONIC_DERIVED_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) +$(addprefix $(DEBS_PATH)/, $(SONIC_DERIVED_DEBS)) : $(DEBS_PATH)/% : .platform $$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS)) $(HEADER) # All noise takes place in main deb recipe, so we are just telling that # we depend on it diff --git a/src/openssh/Makefile b/src/openssh/Makefile index 91d4fd52bc..21bab184b8 100644 --- a/src/openssh/Makefile +++ b/src/openssh/Makefile @@ -3,7 +3,11 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = openssh-server_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = openssh-server-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb +DERIVED_TARGETS = openssh-server-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb \ + openssh-client_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb \ + openssh-client-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb \ + openssh-sftp-server_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb \ + openssh-sftp-server-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Obtain openssh: https://salsa.debian.org/ssh-team/openssh/-/tree/debian/1%258.4p1-5 diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 212b5c70d9..dc73a16c08 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -39,6 +39,11 @@ backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] console_device_types = ['MgmtTsToR'] dhcp_server_enabled_device_types = ['BmcMgmtToRRouter'] +mgmt_device_types = ['BmcMgmtToRRouter', 'MgmtToRRouter', 'MgmtTsToR'] + +# Counters disabled on management devices +mgmt_disabled_counters = ["BUFFER_POOL_WATERMARK", "PFCWD", "PG_DROP", "PG_WATERMARK", "PORT_BUFFER_DROP", "QUEUE", "QUEUE_WATERMARK"] + VLAN_SUB_INTERFACE_SEPARATOR = '.' VLAN_SUB_INTERFACE_VLAN_ID = '10' @@ -2037,6 +2042,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if current_device['type'] in dhcp_server_enabled_device_types: results['DEVICE_METADATA']['localhost']['dhcp_server'] = 'enabled' + # Disable unsupported counters on management devices + if current_device and current_device['type'] in mgmt_device_types: + results["FLEX_COUNTER_TABLE"] = {counter: {"FLEX_COUNTER_STATUS": "disable"} for counter in mgmt_disabled_counters} + return results def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip): diff --git a/src/sonic-config-engine/tests/simple-sample-graph-m0.xml b/src/sonic-config-engine/tests/simple-sample-graph-m0.xml new file mode 100644 index 0000000000..43193b7eb6 --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-graph-m0.xml @@ -0,0 +1,914 @@ + + + + + + false + switch-m0 + 10.0.0.56 + ARISTA01M1 + 10.0.0.57 + 1 + 10 + 3 + + + switch-m0 + FC00::71 + ARISTA01M1 + FC00::72 + 1 + 10 + 3 + + + false + switch-m0 + 10.0.0.64 + ARISTA01MX + 10.0.0.65 + 1 + 10 + 3 + + + switch-m0 + FC00::81 + ARISTA01MX + FC00::82 + 1 + 10 + 3 + + + false + switch-m0 + 10.0.0.58 + ARISTA02M1 + 10.0.0.59 + 1 + 10 + 3 + + + switch-m0 + FC00::75 + ARISTA02M1 + FC00::76 + 1 + 10 + 3 + + + false + switch-m0 + 10.0.0.66 + ARISTA02MX + 10.0.0.67 + 1 + 10 + 3 + + + switch-m0 + FC00::85 + ARISTA02MX + FC00::86 + 1 + 10 + 3 + + + false + switch-m0 + 10.0.0.60 + ARISTA03M1 + 10.0.0.61 + 1 + 10 + 3 + + + switch-m0 + FC00::79 + ARISTA03M1 + FC00::7A + 1 + 10 + 3 + + + false + switch-m0 + 10.0.0.62 + ARISTA04M1 + 10.0.0.63 + 1 + 10 + 3 + + + switch-m0 + FC00::7D + ARISTA04M1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + switch-m0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.65
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.67
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 65200 + ARISTA01M1 + + + + 64001 + ARISTA01MX + + + + 65200 + ARISTA02M1 + + + + 64002 + ARISTA02MX + + + + 65200 + ARISTA03M1 + + + + 65200 + ARISTA04M1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-m0 + + + PortChannel101 + etp49 + + + + PortChannel103 + etp50 + + + + PortChannel105 + etp51 + + + + PortChannel106 + etp52 + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + + + kk1 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2020 + 2020 + Tagged + 192.168.0.0/28 + + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + Tagged + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + + + + + + PortChannel1 + 10.0.0.56/31 + + + + PortChannel1 + FC00::71/126 + + + + PortChannel1001 + 10.0.0.57/31 + + + + PortChannel1001 + FC00::72/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel1 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + + + + + + + + DeviceInterfaceLink + ARISTA01M1 + Ethernet1 + switch-m0 + etp49 + 10000 + + + DeviceInterfaceLink + ARISTA01MX + Ethernet1 + switch-m0 + etp47 + 1000 + + + DeviceInterfaceLink + ARISTA02M1 + Ethernet1 + switch-m0 + etp50 + 10000 + + + DeviceInterfaceLink + ARISTA02MX + Ethernet1 + switch-m0 + etp48 + 1000 + + + DeviceInterfaceLink + ARISTA03M1 + Ethernet1 + switch-m0 + etp51 + 10000 + + + DeviceInterfaceLink + ARISTA04M1 + Ethernet1 + switch-m0 + etp52 + 10000 + + + DeviceInterfaceLink + switch-m0 + etp1 + Servers0 + eth0 + + + DeviceInterfaceLink + switch-m0 + etp2 + Servers1 + eth0 + + + + + switch-m0 + Nokia-M0-7215 + AAA00PrdStr00 + + + ARISTA04M1 + Arista + + + ARISTA02M1 + Arista + + + ARISTA02MX + Arista + + + ARISTA01MX + Arista + + + ARISTA01M1 + Arista + + + ARISTA03M1 + Arista + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/64 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/68 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/72 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/76 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/80 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/84 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/88 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/92 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/96 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/100 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/104 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/108 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/112 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/116 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/120 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/124 + + false + 0 + 0 + 100000 + + + true + 0 + Force10-S6000 + + + DeviceInterface + + 1 + Management1 + false + mgmt1 + 1000 + + + + + + + + switch-m0 + + + DeploymentId + + 1 + + + + + + + switch-m0 + Nokia-M0-7215 +
diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-acl-type-bmcdata.xml b/src/sonic-config-engine/tests/simple-sample-graph-mx.xml similarity index 83% rename from src/sonic-config-engine/tests/simple-sample-graph-case-acl-type-bmcdata.xml rename to src/sonic-config-engine/tests/simple-sample-graph-mx.xml index 6c29fb47e4..db34102010 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-acl-type-bmcdata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-mx.xml @@ -2,138 +2,91 @@ - - switch-t0 - 10.1.0.32 - BGPMonitor - 10.20.30.40 - 30 - 10 - 3 - false - switch-t0 - 10.0.0.56 - ARISTA01T1 - 10.0.0.57 + switch-mx + 10.0.0.64 + ARISTA01M0 + 10.0.0.65 1 - 180 - 60 + 10 + 3 - switch-t0 - FC00::71 - ARISTA01T1 - FC00::72 + switch-mx + FC00::81 + ARISTA01M0 + FC00::82 1 - 180 - 60 + 10 + 3 false - switch-t0 - 10.0.0.58 - ARISTA02T1 - 10.0.0.59 - 1 - 180 - 60 - - - switch-t0 - FC00::75 - ARISTA02T1 - FC00::76 - 1 - 180 - 60 - - - switch-t0 - FC00::75 - ARISTA02T1 - FC00::76 + switch-mx + 10.0.0.66 + ARISTA02M0 + 10.0.0.67 1 - 180 - 60 + 10 + 3 - false - switch-t0 - 10.2.0.20 - CHASSIS_PEER - 10.2.0.21 + switch-mx + FC00::85 + ARISTA02M0 + FC00::86 1 - 180 - 60 - voq + 10 + 3 - 1 - - BGPMonitor - - - BGPPeer -
10.1.0.32
- - - -
-
- -
- - 65100 - switch-t0 + 64001 + switch-mx -
10.0.0.57
+
10.0.0.65
-
10.0.0.59
+
10.0.0.67
- -
10.2.0.21
+ + BGPPeer +
10.1.0.32
+ BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21
- 64600 - ARISTA01T1 - - - - 64600 - ARISTA02T1 - - - - 64600 - ARISTA03T1 - - - - 64600 - ARISTA04T1 + 65100 + ARISTA01M0 65100 - CHASSIS_PEER + ARISTA02M0
@@ -173,13 +126,8 @@ - switch-t0 + switch-mx - - PortChannel1 - fortyGigE0/4 - - @@ -293,54 +241,47 @@ DeviceInterfaceLink + ARISTA01M0 + Ethernet1 + switch-mx + etp47 1000 - ARISTA01T1 - et1 - true - switch-t0 - fortyGigE0/8 - true - - DeviceMgmtLink + + DeviceInterfaceLink + ARISTA02M0 + Ethernet1 + switch-mx + etp48 1000 - switch-t0 - fortyGigE0/16 - true - ChassisMTS1 - mgmt0 - true - - DeviceMgmtLink - 1000 - switch-t0 - Management1 - switch-m0 - Management1 - true + + DeviceInterfaceLink + switch-mx + etp1 + Servers0 + eth0 + + + DeviceInterfaceLink + switch-mx + etp2 + Servers1 + eth0 - - switch-t0 - Force10-S6000 + + switch-mx + Arista-720DT-G48S4 AAA00PrdStr00 - - ARISTA01T1 - Arista - - - ARISTA02T1 - Arista - - - ARISTA03T1 + + ARISTA01M0 Arista - - ARISTA04T1 + + ARISTA02M0 Arista @@ -778,7 +719,7 @@ - switch-t0 + switch-mx DeploymentId @@ -790,6 +731,6 @@ - switch-t0 - Force10-S6000 + switch-mx + Arista-720DT-G48S4 diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 634a5e811e..92834ee36f 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -520,8 +520,8 @@ def test_minigraph_acl_type_bmcdata(self): 'type': 'BMCDATAV6', } # TC1: Minigraph contains acl table type BmcData - sample_graph = os.path.join(self.test_dir,'simple-sample-graph-case-acl-type-bmcdata.xml') - result = minigraph.parse_xml(sample_graph) + sample_mx_graph = os.path.join(self.test_dir,'simple-sample-graph-mx.xml') + result = minigraph.parse_xml(sample_mx_graph) self.assertIn('ACL_TABLE_TYPE', result) self.assertIn('BMCDATA', result['ACL_TABLE_TYPE']) self.assertIn('BMCDATAV6', result['ACL_TABLE_TYPE']) @@ -549,3 +549,22 @@ def test_parse_device_desc_xml_mgmt_interface(self): self.assertEqual(len(mgmt_intf.keys()), 1) self.assertTrue(('eth0', 'FC00:1::32/64') in mgmt_intf.keys()) self.assertTrue(ipaddress.ip_address(u'fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr']) + + def test_mgmt_device_disable_counters(self): + expected_mgmt_disabled_counters = ["BUFFER_POOL_WATERMARK", "PFCWD", "PG_DROP", "PG_WATERMARK", "PORT_BUFFER_DROP", "QUEUE", "QUEUE_WATERMARK"] + expected_mgmt_enabled_counters = ["ACL", "PORT", "RIF"] + # TC1: For M0 and Mx minigraph, counters are configured as expected + mgmt_graphs = ['simple-sample-graph-mx.xml', 'simple-sample-graph-m0.xml'] + for graph in mgmt_graphs: + graph_path = os.path.join(self.test_dir, graph) + result = minigraph.parse_xml(graph_path) + self.assertIn('FLEX_COUNTER_TABLE', result) + for counter in expected_mgmt_disabled_counters: + self.assertIn(counter, result['FLEX_COUNTER_TABLE']) + self.assertDictEqual(result['FLEX_COUNTER_TABLE'][counter], {'FLEX_COUNTER_STATUS': 'disable'}) + for counter in expected_mgmt_enabled_counters: + if counter in result['FLEX_COUNTER_TABLE']: + self.assertDictEqual(result['FLEX_COUNTER_TABLE'][counter], {'FLEX_COUNTER_STATUS': 'enable'}) + # TC2: For other minigraph, result should not contain FLEX_COUNTER_TABLE + result = minigraph.parse_xml(self.sample_graph) + self.assertNotIn('FLEX_COUNTER_TABLE', result)