Skip to content

Commit

Permalink
integration-tests: add set plugin startup time env var
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej committed Jan 11, 2023
1 parent 77b2a9f commit 965b652
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ OK
## Robot framework
Note the root privileges when invoking the command (datastore permission issues otherwise, item not found):

The plugin wait start time can be modified via the env var `SYSREPO_INTEGRATION_PLUGIN_TIMEOUT_SECONDS`. The default value is `0.5s`. It's set in `robot-ietf-interfaces/InterfacesInit.resource` and `robot-ietf-routing/RoutingInit.resource`.

To test the interfaces plugin (change env var path):
```
# SYSREPO_INTERFACES_PLUGIN_PATH=/path/to/interfaces/plugin/executable robot robot-ietf-interfaces
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/robot-ietf-interfaces/InterfaceInit.resource
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Library RPA.JSON
Library Process

*** Variables ***
${Xpath Interfaces} /ietf-interfaces:interfaces
${Running Datastore} running
${Xpath Interfaces} /ietf-interfaces:interfaces
${Running Datastore} running
${Plugin Timeout Seconds Default} 0.5s
${Plugin Timeout Seconds} %{SYSREPO_INTEGRATION_PLUGIN_TIMEOUT_SECONDS=${Plugin Timeout Seconds Default}}

*** Keywords ***
Restore Initial Running Datastore
Edit Datastore Config ${Connection Default} ${Session Running} ${If Init Str} json
Check If Datastore Is Restored
#Check If Datastore Is Restored

Check If Datastore Is Restored
[Documentation] Make sure the initial datastore is restored
Expand Down Expand Up @@ -46,7 +48,7 @@ Cleanup Interfaces
Start Plugin
${Plugin}= Start Process %{SYSREPO_INTERFACES_PLUGIN_PATH}
Set Global Variable ${Plugin}
Wait For Process ${Plugin} timeout=0.1s on_timeout=continue
Wait For Process ${Plugin} timeout=${Plugin Timeout Seconds} on_timeout=continue

Stop Plugin
Terminate Process ${Plugin}
3 changes: 2 additions & 1 deletion tests/integration/robot-ietf-routing/RoutingInit.resource
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Library Process
*** Variables ***
${Xpath Routing} /ietf-routing:routing
${Running Datastore} running
${Plugin Timeout Seconds} 0.5s
${Plugin Timeout Seconds Default} 0.5s
${Plugin Timeout Seconds} %{SYSREPO_INTEGRATION_PLUGIN_TIMEOUT_SECONDS=${Plugin Timeout Seconds Default}}

*** Keywords ***
Restore Initial Running Datastore
Expand Down

0 comments on commit 965b652

Please sign in to comment.