From 6260be73319bbee501e49ae564d085d2ae6f3173 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 3 Jul 2024 22:18:25 +0530 Subject: [PATCH] Removing new tests and adding ptp_settings key in old tests. --- .../ptp-tests-l2leaf2-ptp-settings-key.cfg | 68 --------------- .../intended/configs/ptp-tests-leaf1.cfg | 19 ---- .../intended/configs/ptp-tests-leaf2.cfg | 19 ---- .../ptp-tests-l2leaf2-ptp-settings-key.yml | 87 ------------------- .../structured_configs/ptp-tests-leaf1.yml | 26 ------ .../structured_configs/ptp-tests-leaf2.yml | 26 ------ .../group_vars/PTP_TESTS_L2LEAFS.yml | 8 -- .../ptp-tests-l2leaf2-ptp-settings-key.yml | 11 --- .../inventory/host_vars/ptp-tests-leaf2.yml | 5 ++ .../inventory/hosts.yml | 1 - .../structured_config/base/__init__.py | 4 +- 11 files changed, 7 insertions(+), 267 deletions(-) delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-l2leaf2-ptp-settings-key.cfg delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-l2leaf2-ptp-settings-key.yml delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-l2leaf2-ptp-settings-key.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-l2leaf2-ptp-settings-key.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-l2leaf2-ptp-settings-key.cfg deleted file mode 100644 index 3c0ab457a6b..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-l2leaf2-ptp-settings-key.cfg +++ /dev/null @@ -1,68 +0,0 @@ -!RANCID-CONTENT-TYPE: arista -! -vlan internal order ascending range 1006 1199 -! -transceiver qsfp default-mode 4x10G -! -service routing protocols model multi-agent -! -hostname ptp-tests-l2leaf2-ptp-settings-key -! -ptp clock-identity 00:1C:73:7f:00:04 -ptp priority1 127 -ptp priority2 4 -ptp domain 127 -ptp mode boundary -ptp monitor threshold offset-from-master 250 -ptp monitor threshold mean-path-delay 1500 -ptp monitor sequence-id -ptp monitor threshold missing-message announce 3 sequence-ids -ptp monitor threshold missing-message delay-resp 3 sequence-ids -ptp monitor threshold missing-message follow-up 3 sequence-ids -ptp monitor threshold missing-message sync 3 sequence-ids -! -spanning-tree mode mstp -spanning-tree mst 0 priority 32768 -! -no enable password -no aaa root -! -vlan 11 - name VLAN11 -! -vrf instance MGMT -! -interface Port-Channel1 - description PTP-TEST-LEAF_Po16 - no shutdown - switchport - switchport trunk allowed vlan 11 - switchport mode trunk - ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 -! -interface Ethernet1 - description PTP-TESTS-LEAF1_Ethernet16 - no shutdown - channel-group 1 mode active -! -interface Ethernet2 - description PTP-TESTS-LEAF2_Ethernet16 - no shutdown - channel-group 1 mode active -no ip routing vrf MGMT -! -ip route vrf MGMT 0.0.0.0/0 192.168.0.1 -! -management api http-commands - protocol https - no shutdown - ! - vrf MGMT - no shutdown -! -end diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg index 92dd8c03c08..4a4cb4f1802 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg @@ -106,20 +106,6 @@ interface Port-Channel14 switchport mode trunk mlag 14 ! -interface Port-Channel16 - description PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Po1 - no shutdown - switchport - switchport trunk allowed vlan 11 - switchport mode trunk - mlag 16 - ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 -! interface Ethernet1 description P2P_LINK_TO_PTP-TESTS-SPINE1_Ethernet1 no shutdown @@ -218,11 +204,6 @@ interface Ethernet14 no shutdown channel-group 14 mode active ! -interface Ethernet16 - description PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Ethernet1 - no shutdown - channel-group 16 mode active -! interface Loopback0 description EVPN_Overlay_Peering no shutdown diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf2.cfg index 5aae38bb113..0e0510d5219 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf2.cfg @@ -113,20 +113,6 @@ interface Port-Channel14 switchport mode trunk mlag 14 ! -interface Port-Channel16 - description PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Po1 - no shutdown - switchport - switchport trunk allowed vlan 11 - switchport mode trunk - mlag 16 - ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 -! interface Ethernet1 description P2P_LINK_TO_PTP-TESTS-SPINE1_Ethernet3 no shutdown @@ -198,11 +184,6 @@ interface Ethernet14 no shutdown channel-group 14 mode active ! -interface Ethernet16 - description PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Ethernet2 - no shutdown - channel-group 16 mode active -! interface Loopback0 description EVPN_Overlay_Peering no shutdown diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-l2leaf2-ptp-settings-key.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-l2leaf2-ptp-settings-key.yml deleted file mode 100644 index 0c5d7ef47d4..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-l2leaf2-ptp-settings-key.yml +++ /dev/null @@ -1,87 +0,0 @@ -hostname: ptp-tests-l2leaf2-ptp-settings-key -is_deployed: true -static_routes: -- vrf: MGMT - destination_address_prefix: 0.0.0.0/0 - gateway: 192.168.0.1 -service_routing_protocols_model: multi-agent -vlan_internal_order: - allocation: ascending - range: - beginning: 1006 - ending: 1199 -spanning_tree: - mode: mstp - mst_instances: - - id: '0' - priority: 32768 -vrfs: -- name: MGMT - ip_routing: false -management_api_http: - enable_vrfs: - - name: MGMT - enable_https: true -ptp: - mode: boundary - clock_identity: 00:1C:73:7f:00:04 - priority1: 127 - priority2: 4 - domain: 127 - monitor: - enabled: true - threshold: - offset_from_master: 250 - mean_path_delay: 1500 - missing_message: - sequence_ids: - enabled: true - announce: 3 - delay_resp: 3 - follow_up: 3 - sync: 3 -ethernet_interfaces: -- name: Ethernet1 - peer: ptp-tests-leaf1 - peer_interface: Ethernet16 - peer_type: l3leaf - description: PTP-TESTS-LEAF1_Ethernet16 - shutdown: false - type: port-channel-member - channel_group: - id: 1 - mode: active -- name: Ethernet2 - peer: ptp-tests-leaf2 - peer_interface: Ethernet16 - peer_type: l3leaf - description: PTP-TESTS-LEAF2_Ethernet16 - shutdown: false - type: port-channel-member - channel_group: - id: 1 - mode: active -port_channel_interfaces: -- name: Port-Channel1 - description: PTP-TEST-LEAF_Po16 - type: switched - shutdown: false - mode: trunk - vlans: '11' - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true -vlans: -- id: 11 - name: VLAN11 - tenant: PTP -ip_igmp_snooping: - globally_enabled: true -metadata: - platform: vEOS-lab diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml index de930d38698..57909c6d5b6 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml @@ -238,22 +238,6 @@ port_channel_interfaces: mode: trunk vlans: '11' mlag: 14 -- name: Port-Channel16 - description: PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Po1 - type: switched - shutdown: false - mode: trunk - vlans: '11' - mlag: 16 - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true - name: Port-Channel6 description: Endpoint-with-mpass type: switched @@ -359,16 +343,6 @@ ethernet_interfaces: channel_group: id: 14 mode: active -- name: Ethernet16 - peer: ptp-tests-l2leaf2-ptp-settings-key - peer_interface: Ethernet1 - peer_type: l2leaf - description: PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Ethernet1 - shutdown: false - type: port-channel-member - channel_group: - id: 16 - mode: active - name: Ethernet13 peer: bmca-endpoint peer_interface: eth1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf2.yml index cb1863792c6..bc20876d01b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf2.yml @@ -249,22 +249,6 @@ port_channel_interfaces: mode: trunk vlans: '11' mlag: 14 -- name: Port-Channel16 - description: PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Po1 - type: switched - shutdown: false - mode: trunk - vlans: '11' - mlag: 16 - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true - name: Port-Channel6 description: Endpoint-with-mpass type: switched @@ -370,16 +354,6 @@ ethernet_interfaces: channel_group: id: 14 mode: active -- name: Ethernet16 - peer: ptp-tests-l2leaf2-ptp-settings-key - peer_interface: Ethernet2 - peer_type: l2leaf - description: PTP-TESTS-L2LEAF2-PTP-SETTINGS-KEY_Ethernet2 - shutdown: false - type: port-channel-member - channel_group: - id: 16 - mode: active - name: Ethernet5 peer: video-endpoint peer_interface: PCI2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS_L2LEAFS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS_L2LEAFS.yml index 74d588a26f9..1af27a4dca4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS_L2LEAFS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS_L2LEAFS.yml @@ -36,11 +36,3 @@ l2leaf: enabled: true uplink_ptp: enable: false - - - name: ptp-tests-l2leaf2-ptp-settings-key - id: 4 - uplink_switch_interfaces: - - Ethernet16 - - Ethernet16 - ptp: - enabled: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-l2leaf2-ptp-settings-key.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-l2leaf2-ptp-settings-key.yml deleted file mode 100644 index 6c46cc42343..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-l2leaf2-ptp-settings-key.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -# Test `ptp_settings` key. -ptp_settings: - enabled: true - auto_clock_identity: true - -# Test `ptp_settings` takes precedence to `ptp` setting. -ptp: - enabled: false - auto_clock_identity: false diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-leaf2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-leaf2.yml index 6d887a481b7..94ffb8f4aaf 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-leaf2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-leaf2.yml @@ -3,3 +3,8 @@ ptp_settings: enabled: true auto_clock_identity: false + +# Test `ptp_settings` setting overrides `ptp` setting. +ptp: + enabled: false + auto_clock_identity: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/hosts.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/hosts.yml index 866179d3920..121d2ceb791 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/hosts.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/hosts.yml @@ -248,7 +248,6 @@ all: ptp-tests-l2leaf1-ptp-disabled: ptp-tests-l2leaf2-ptp-enabled: ptp-tests-l2leaf2-ptp-enabled-uplink-disabled: - ptp-tests-l2leaf2-ptp-settings-key: SFLOW_TESTS: children: SFLOW_TESTS_SPINES: diff --git a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py index 7c9765b0cc6..08e0c7821f9 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py +++ b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py @@ -657,10 +657,10 @@ def ptp(self) -> dict | None: PTP priority2 is set in the code below, calculated based on the node id: default_priority2 = self.id % 256 """ - if not self.shared_utils.ptp_enabled: + if not self.shared_utils.ptp_enabled and not get(self._hostvars, "ptp_settings.enabled"): # Since we have overlapping data model "ptp" between eos_designs and eos_cli_config_gen, # we need to overwrite the input dict if set but not enabled. - if get(self._hostvars, "ptp") is not None or get(self._hostvars, "ptp_settings") is not None: + if get(self._hostvars, "ptp") is not None: return {} return None default_ptp_domain = default(get(self._hostvars, "ptp_settings.domain"), get(self._hostvars, "ptp.domain"), 127)