Skip to content
Snippets Groups Projects

`validate_router` - change in P-BGP verb

Merged Aleksandr Kurbatov requested to merge fix/nat-884-bgp-verification into develop
All threads resolved!
1 file
+ 9
11
Compare changes
  • Side-by-side
  • Inline
@@ -4,6 +4,7 @@ import pytest
from infoblox_client import objects
from orchestrator.types import SubscriptionLifecycle
from gso.products.product_blocks.router import RouterRole
from gso.products.product_types.router import Router
from gso.utils.shared_enums import Vendor
from test.services.conftest import MockedKentikClient
@@ -16,6 +17,7 @@ from test.workflows import (
@pytest.mark.parametrize("router_state", [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE])
@pytest.mark.parametrize("router_role", [RouterRole.P, RouterRole.PE])
@pytest.mark.workflow()
@patch("gso.services.infoblox.find_host_by_fqdn")
@patch("gso.services.lso_client._send_request")
@@ -30,14 +32,15 @@ def test_validate_nokia_router_success(
mock_find_host_by_fqdn,
router_subscription_factory,
faker,
data_config_filename,
geant_partner,
router_state,
router_role,
):
mock_validate_librenms_device.return_value = None
router_subscription_factory(router_role=RouterRole.P)
router_subscription_factory(router_role=RouterRole.PE)
mock_kentik_client.return_value = MockedKentikClient
# Run workflow
subscription_id = router_subscription_factory(status=router_state)
subscription_id = router_subscription_factory(status=router_state, router_role=router_role)
mock_fqdn = Router.from_subscription(subscription_id).router.router_fqdn
mock_v4 = faker.ipv4()
mock_find_host_by_fqdn.return_value = objects.HostRecord(
@@ -62,7 +65,9 @@ def test_validate_nokia_router_success(
state = extract_state(result)
subscription_id = state["subscription_id"]
for _ in range(2):
lso_execution_count = 2 if router_role == RouterRole.P else 3
for _ in range(lso_execution_count):
result, step_log = assert_lso_success(result, process_stat, step_log)
assert_complete(result)
@@ -71,7 +76,7 @@ def test_validate_nokia_router_success(
subscription = Router.from_subscription(subscription_id)
assert subscription.status == router_state
assert mock_execute_playbook.call_count == 2
assert mock_execute_playbook.call_count == lso_execution_count
assert mock_find_host_by_fqdn.call_count == 1
assert mock_get_device_by_name.call_count == 1
assert mock_validate_librenms_device.call_count == 1
@@ -79,12 +84,7 @@ def test_validate_nokia_router_success(
@pytest.mark.workflow()
def test_validate_juniper_router_success(
router_subscription_factory,
faker,
data_config_filename,
geant_partner,
):
def test_validate_juniper_router_success(router_subscription_factory):
# Run workflow
subscription_id = router_subscription_factory(vendor=Vendor.JUNIPER)
Loading