Skip to content

Commit

Permalink
set system name on mgmt rpcs
Browse files Browse the repository at this point in the history
Features: pool
Allow-unstable-test: true
Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Feb 3, 2025
1 parent 37fd8dc commit 1810850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/control/lib/control/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ func PoolExclude(ctx context.Context, rpcClient UnaryInvoker, req *PoolRanksReq)
if err := convert.Types(req, pbReq); err != nil {
return nil, errors.Wrapf(err, "convert %T->%T", req, pbReq)
}
pbReq.Sys = req.getSystem(rpcClient)

req.setRPC(func(ctx context.Context, conn *grpc.ClientConn) (proto.Message, error) {
return mgmtpb.NewMgmtSvcClient(conn).PoolExclude(ctx, pbReq)
Expand Down Expand Up @@ -874,6 +875,7 @@ func PoolDrain(ctx context.Context, rpcClient UnaryInvoker, req *PoolRanksReq) (
if err := convert.Types(req, pbReq); err != nil {
return nil, errors.Wrapf(err, "convert %T->%T", req, pbReq)
}
pbReq.Sys = req.getSystem(rpcClient)

req.setRPC(func(ctx context.Context, conn *grpc.ClientConn) (proto.Message, error) {
return mgmtpb.NewMgmtSvcClient(conn).PoolDrain(ctx, pbReq)
Expand Down Expand Up @@ -934,6 +936,7 @@ func PoolReintegrate(ctx context.Context, rpcClient UnaryInvoker, req *PoolRanks
if err := convert.Types(req, pbReq); err != nil {
return nil, errors.Wrapf(err, "convert %T->%T", req, pbReq)
}
pbReq.Sys = req.getSystem(rpcClient)

req.setRPC(func(ctx context.Context, conn *grpc.ClientConn) (proto.Message, error) {
return mgmtpb.NewMgmtSvcClient(conn).PoolReintegrate(ctx, pbReq)
Expand Down
15 changes: 0 additions & 15 deletions src/mgmt/tests/srv_drpc_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1795,21 +1795,6 @@ setup_exclude_drpc_call(Drpc__Call *call, char *uuid, uint32_t rank)
pack_pool_exclude_req(call, &req);
}

static void
expect_drpc_ranks_resp_with_error(Drpc__Response *resp, int exp_error)
{
Mgmt__PoolRanksResp *pc_resp = NULL;

assert_int_equal(resp->status, DRPC__STATUS__SUCCESS);
assert_non_null(resp->body.data);

pc_resp = mgmt__pool_ranks_resp__unpack(NULL, resp->body.len, resp->body.data);
assert_non_null(pc_resp);
assert_int_equal(pc_resp->status, exp_error);

mgmt__pool_ranks_resp__free_unpacked(pc_resp, NULL);
}

static void
test_drpc_exclude_bad_uuid(void **state)
{
Expand Down

0 comments on commit 1810850

Please sign in to comment.