Skip to content
Snippets Groups Projects
Commit 036b6b93 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Add verification of SDP mesh config on a PE in `validate_router`

Verification of P neighbors can be skipped as we don't have them
anymore.
parent 5aefbed9
No related branches found
No related tags found
No related merge requests found
Pipeline #94222 failed
...@@ -100,6 +100,34 @@ def verify_pe_mesh_in_pe(subscription: dict[str, Any]) -> LSOState: ...@@ -100,6 +100,34 @@ def verify_pe_mesh_in_pe(subscription: dict[str, Any]) -> LSOState:
} }
@step("Verify SDP mesh on the PE router")
def verify_sdp_single_pe(subscription: dict[str, Any]) -> LSOState:
"""Verify SDP mesh on the PE router."""
extra_vars = {
"dry_run": True,
"subscription": subscription,
"verb": "add_pe_to_sdp_mesh",
"pe_router_list": generate_inventory_for_routers(
router_role=RouterRole.PE,
exclude_routers=[subscription["router"]["router_fqdn"]],
)["all"]["hosts"],
"is_verification_workflow": "true",
}
if not extra_vars["pe_router_list"]:
return {
"playbook_name": "",
"inventory": {"all": {"hosts": {}}},
"extra_vars": {},
}
return {
"playbook_name": "gap_ansible/playbooks/update_pe_sdp_mesh.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
"extra_vars": extra_vars,
}
@step("Verify PE BGP P-ONLY neighbors") @step("Verify PE BGP P-ONLY neighbors")
def verify_all_p_in_pe(subscription: dict[str, Any]) -> LSOState: def verify_all_p_in_pe(subscription: dict[str, Any]) -> LSOState:
"""Verify P neighbors in `P-ONLY` group on a PE router.""" """Verify P neighbors in `P-ONLY` group on a PE router."""
...@@ -173,7 +201,7 @@ def check_kentik_entry_exists(subscription: Router) -> None: ...@@ -173,7 +201,7 @@ def check_kentik_entry_exists(subscription: Router) -> None:
raise ProcessFailureError( raise ProcessFailureError(
message="Device in Kentik incorrectly configured", message="Device in Kentik incorrectly configured",
details=f"Kentik device {subscription.router.router_fqdn} has the archiving license " details=f"Kentik device {subscription.router.router_fqdn} has the archiving license "
f"{archive_plan["name"]} applied to it, despite the existence of active layer 3 services.", f"{archive_plan['name']} applied to it, despite the existence of active layer 3 services.",
) )
placeholder_plan = client.get_plan_by_name(kentik_params.placeholder_license_key) placeholder_plan = client.get_plan_by_name(kentik_params.placeholder_license_key)
...@@ -181,7 +209,7 @@ def check_kentik_entry_exists(subscription: Router) -> None: ...@@ -181,7 +209,7 @@ def check_kentik_entry_exists(subscription: Router) -> None:
raise ProcessFailureError( raise ProcessFailureError(
message="Device in Kentik incorrectly configured", message="Device in Kentik incorrectly configured",
details=f"Kentik device {subscription.router.router_fqdn} has the placeholder license " details=f"Kentik device {subscription.router.router_fqdn} has the placeholder license "
f"{placeholder_plan["name"]} applied to it, despite the existence of active layer 3 services.", f"{placeholder_plan['name']} applied to it, despite the existence of active layer 3 services.",
) )
...@@ -231,7 +259,8 @@ def validate_router() -> StepList: ...@@ -231,7 +259,8 @@ def validate_router() -> StepList:
>> anonymous_lso_interaction(verify_base_config) >> anonymous_lso_interaction(verify_base_config)
>> is_p_router(anonymous_lso_interaction(verify_p_ibgp)) >> is_p_router(anonymous_lso_interaction(verify_p_ibgp))
>> is_pe_router(anonymous_lso_interaction(verify_pe_mesh_in_pe)) >> is_pe_router(anonymous_lso_interaction(verify_pe_mesh_in_pe))
>> is_pe_router(anonymous_lso_interaction(verify_all_p_in_pe)) >> is_pe_router(anonymous_lso_interaction(verify_sdp_single_pe))
# >> is_pe_router(anonymous_lso_interaction(verify_all_p_in_pe))
>> resync >> resync
>> done >> done
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment