diff --git a/tests/integration/robot-ietf-routing/RoutingInit.resource b/tests/integration/robot-ietf-routing/RoutingInit.resource index 50c154d8..6132a4fa 100644 --- a/tests/integration/robot-ietf-routing/RoutingInit.resource +++ b/tests/integration/robot-ietf-routing/RoutingInit.resource @@ -5,10 +5,12 @@ Library Process *** Variables *** ${Xpath Routing} /ietf-routing:routing +${Running Datastore} running +${Plugin Timeout Seconds} 0.5s *** Keywords *** Restore Initial Running Datastore - Edit Datastore Config ${Connection Default} ${Session Running} ${Routing Init Running Str} json + Edit Datastore Config ${Connection Default} ${Session Running} ${Route Init Str} json Check If Datastore Is Restored Check If Datastore Is Restored @@ -18,4 +20,34 @@ Check If Datastore Is Restored ... ${Session Running} ... ${Xpath Routing} ... json - Should Be Equal As Strings ${Restored} ${Routing Init Running Str} msg="failed to restore inital running datastore" + Should Be Equal As Strings ${Restored} ${Route Init Str} msg="failed to restore inital running datastore" + +Init Running Session + ${Session Running}= Open Datastore Session ${Connection Default} ${Running Datastore} + Set Global Variable ${Session Running} + ${Route Init Str}= Get Datastore Data + ... ${Connection Default} + ... ${Session Running} + ... ${Xpath Routing} + ... json + Set Global Variable ${Route Init Str} + &{Route Init JSON}= Convert String To JSON ${Route Init Str} + Set Global Variable ${Route Init JSON} + +Connect Routing + Start Plugin + ${Connection Default}= Open Sysrepo Connection + Set Global Variable ${Connection Default} + Init Running Session + +Cleanup Routing + Restore Initial Running Datastore + Stop Plugin + +Start Plugin + ${Plugin}= Start Process %{SYSREPO_ROUTING_PLUGIN_PATH} + Set Global Variable ${Plugin} + Wait For Process ${Plugin} timeout=${Plugin Timeout Seconds} on_timeout=continue + +Stop Plugin + Terminate Process ${Plugin} diff --git a/tests/integration/robot-ietf-routing/__init__.robot b/tests/integration/robot-ietf-routing/__init__.robot index 7ecccded..b23990d1 100644 --- a/tests/integration/robot-ietf-routing/__init__.robot +++ b/tests/integration/robot-ietf-routing/__init__.robot @@ -4,57 +4,7 @@ Library RPA.JSON Library Process Resource RoutingInit.resource -Suite Setup Setup IETF Routing -Suite Teardown Cleanup IETF Routing -Test Teardown Restore Initial Running Datastore - -*** Variables *** -${Xpath Routing} /ietf-routing:routing -${Operational Datastore} operational -${Running Datastore} running - - -*** Keywords *** -Setup IETF Routing - [Documentation] Create a default connection and running and operational sessions - Start Plugin - ${Connection Default}= Open Sysrepo Connection - Set Global Variable ${Connection Default} - Init Running Session - Init Operational Session - -Start Plugin - ${Plugin}= Start Process %{SYSREPO_ROUTING_PLUGIN_PATH} - Set Suite Variable ${Plugin} - Wait For Process ${Plugin} timeout=2s on_timeout=continue - -Init Running Session - ${Session Running}= Open Datastore Session ${Connection Default} ${Running Datastore} - Set Global Variable ${Session Running} - ${Routing Init Running Str}= Get Datastore Data - ... ${Connection Default} - ... ${Session RUnning} - ... ${Xpath Routing} - ... json - Set Global Variable ${Routing Init Running Str} - &{Routing Init Running JSON}= Convert String To JSON ${Routing Init Running Str} - Set Global Variable ${Routing Init Running JSON} - -Init Operational Session - ${Session Operational}= Open Datastore Session ${Connection Default} ${Operational Datastore} - Set Global Variable ${Session Operational} - ${Routing Init Operational Str}= Get Datastore Data - ... ${Connection Default} - ... ${Session Operational} - ... ${Xpath Routing} - ... json - Set Global Variable ${Routing Init Operational Str} - &{Routing Init Operational JSON}= Convert String To JSON ${Routing Init Operational Str} - Set Global Variable ${Routing Init Operational JSON} - -Cleanup IETF Routing - [Documentation] Restore initial running datastore - Terminate Process ${Plugin} - Close All Sysrepo Connections And Sessions +Test Setup Connect Routing +Test Teardown Cleanup Routing