Skip to content

Commit

Permalink
document expected_fees and add example for kill_node
Browse files Browse the repository at this point in the history
  • Loading branch information
czepluch authored and brainbot-devops committed Oct 29, 2019
1 parent e8d0bac commit 44a7b89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions examples/scenario-example-v2.yaml
Expand Up @@ -116,6 +116,7 @@ scenario:
- assert: {from: 2, to: 1, total_deposit: 0, balance: 0, state: "opened"}
- stop_node: 2
- start_node: 2
- kill_node: 2
- parallel:
name: "Deposit reverse"
tasks:
Expand Down Expand Up @@ -158,6 +159,8 @@ scenario:
# - stop_node: 0
# - update_node_options: {node: 0, options: {matrix-server: "https://..."}}
# - start_node: 0
# ## Kill a node to emulate unexpected shut down
# - kill_node: 0
# ## Assert on multiple channels without knowing the explicit peers
# - assert_all: {from: 0, count: 2, balances: [10, 10], total_deposits: [10, 10], states: ['opened', 'opened']}
# ## Open channel to arbitrary address
Expand Down
15 changes: 11 additions & 4 deletions scenario_player/tasks/services.py
Expand Up @@ -112,22 +112,29 @@ class AssertPFSHistoryTask(RESTAPIActionTask):
If set to true the list of routes is de-duplicated before being checked against
``expected_routes``.
- ``expected_fees``
Explicit list of expected fees per request.
Example usages:
# 4 requests where made from source node 0
# 4 requests were made from source node 0
assert_pfs_history: {source: 0, request_count: 4}
# 4 requests where made from source node 0 to target node 1
# 4 requests were made from source node 0 to target node 1
assert_pfs_history: {source: 0, target: 1, request_count: 4}
# 4 requests where made from source node 0 to target node 1 and 3 routes each have been
# 4 requests were made from source node 0 to target node 1 and 3 routes each have been
# returned
assert_pfs_history: {source: 0, target: 1, request_count: 4, routes_count: 3}
# 4 requests where made from source node 0 to target node 1 and the specified number of
# 4 requests were made from source node 0 to target node 1 and the specified number of
# routes have been returned
assert_pfs_history: {source: 0, target: 1, request_count: 4, routes_count: [3, 2, 1, 2]}
# 2 requests were made from source node 0 to target node 1 and the expected fees of
# 100 tokens for each request have been returned.
assert_pfs_history: {source: 0, target: 1, request_count: 2, expected_fees: [100, 100]}
# The listed routes have been returned for requests from source node 0 to target node 1
assert_pfs_history:
source: 0
Expand Down

0 comments on commit 44a7b89

Please sign in to comment.