forked from lei.chen/myxce
fix(admin-config-tool): unwrap Request reply envelope before decoding as RequestReply
config push crashed on every real controller with a capnp KjException --
xce_reply() wraps every reply in an outer Request{body.replymsg} envelope,
but discovery.py/push.py decoded raw wire bytes directly as a bare
RequestReply. Adds a shared decode_reply() unwrap point used by both call
sites, and fixes the same wrong-shape assumption baked into task 5.6's
and test_cli.py's mock-server fixtures.
This commit is contained in:
parent
46bbdaa9a6
commit
915e6fdf64
7 changed files with 231 additions and 26 deletions
|
|
@ -196,7 +196,7 @@ def cluster_bin(tmp_path):
|
|||
return str(path)
|
||||
|
||||
|
||||
def test_config_push_success_exits_zero(mock_controller, cluster_bin):
|
||||
def test_config_push_success_exits_zero(mock_controller, cluster_bin, wrap_reply):
|
||||
from xcecommon import wire
|
||||
|
||||
mod = load_schema()
|
||||
|
|
@ -209,7 +209,7 @@ def test_config_push_success_exits_zero(mock_controller, cluster_bin):
|
|||
upgrade_reply.versionTag = 5
|
||||
upgrade_reply.ackedCount = 3
|
||||
upgrade_reply.error = ""
|
||||
wire.send_frame(conn, reply.to_bytes())
|
||||
wire.send_frame(conn, wrap_reply(reply))
|
||||
|
||||
srv = mock_controller(_handler)
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ def test_config_push_success_exits_zero(mock_controller, cluster_bin):
|
|||
assert "ackedCount=3" in result.output
|
||||
|
||||
|
||||
def test_config_push_zero_acked_count_exits_nonzero(mock_controller, cluster_bin):
|
||||
def test_config_push_zero_acked_count_exits_nonzero(mock_controller, cluster_bin, wrap_reply):
|
||||
from xcecommon import wire
|
||||
|
||||
mod = load_schema()
|
||||
|
|
@ -237,7 +237,7 @@ def test_config_push_zero_acked_count_exits_nonzero(mock_controller, cluster_bin
|
|||
upgrade_reply.versionTag = 0
|
||||
upgrade_reply.ackedCount = 0
|
||||
upgrade_reply.error = "no quorum"
|
||||
wire.send_frame(conn, reply.to_bytes())
|
||||
wire.send_frame(conn, wrap_reply(reply))
|
||||
|
||||
srv = mock_controller(_handler)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue