Skip to content

Commit 075c28c

Browse files
committed
Add test case test_get_key_creates_shares_on_hubs
1 parent ce362f6 commit 075c28c

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

system_tests/system_test_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def check_wait_for_all_nodes_started_output(output):
163163
)
164164

165165

166-
def status_topology():
166+
def status_topology() -> dict:
167167
"""
168168
Get status for a topology.
169169
"""
@@ -176,7 +176,7 @@ def status_topology():
176176
return status
177177

178178

179-
def status_node(node_type, node_name):
179+
def status_node(node_type: str, node_name: str) -> dict:
180180
"""
181181
Get status for a node.
182182
"""

system_tests/test_share_storage.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Test share storage at hubs.
3+
"""
4+
5+
import sys
6+
import pytest
7+
from . import system_test_common
8+
9+
10+
@pytest.fixture(autouse=True)
11+
def setup_and_teardown():
12+
"""
13+
Setup and teardown for each test.
14+
"""
15+
system_test_common.start_topology()
16+
yield
17+
system_test_common.stop_topology()
18+
19+
20+
def test_get_key_creates_shares_on_hubs():
21+
"""
22+
Test that getting a key on the master client results in shares being created on the hubs.
23+
"""
24+
key_id = system_test_common.get_key("sam", "sofia")
25+
status = system_test_common.status_node("hub", "hank")
26+
assert "shares" in status
27+
shares = status["shares"]
28+
assert len(shares) == 1
29+
share = shares[0]
30+
assert share["key_id"] == key_id
31+
assert share["master_sae_id"] == "sam"
32+
assert share["slave_sae_id"] == "sofia"
33+
assert share["share_index"] == 0

0 commit comments

Comments
 (0)