From eb683e9cfcdfea0fd8d3cfbccc640111217ffe47 Mon Sep 17 00:00:00 2001 From: Tom Nabarro Date: Tue, 7 Jan 2025 13:26:04 +0000 Subject: [PATCH] more naming reverts Features: control Signed-off-by: Tom Nabarro --- src/control/security/grpc_authorization.go | 2 +- .../security/grpc_authorization_test.go | 2 +- src/control/server/mgmt_pool_test.go | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/control/security/grpc_authorization.go b/src/control/security/grpc_authorization.go index c955b27e417..dc80a114921 100644 --- a/src/control/security/grpc_authorization.go +++ b/src/control/security/grpc_authorization.go @@ -64,7 +64,7 @@ var methodAuthorizations = map[string][]Component{ "/mgmt.MgmtSvc/PoolDeleteACL": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolExclude": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolDrain": {ComponentAdmin}, - "/mgmt.MgmtSvc/PoolReint": {ComponentAdmin}, + "/mgmt.MgmtSvc/PoolReintegrate": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolEvict": {ComponentAdmin, ComponentAgent}, "/mgmt.MgmtSvc/PoolExtend": {ComponentAdmin}, "/mgmt.MgmtSvc/GetAttachInfo": {ComponentAgent}, diff --git a/src/control/security/grpc_authorization_test.go b/src/control/security/grpc_authorization_test.go index 24662c4004e..cbb6026ea0f 100644 --- a/src/control/security/grpc_authorization_test.go +++ b/src/control/security/grpc_authorization_test.go @@ -89,7 +89,7 @@ func TestSecurity_ComponentHasAccess(t *testing.T) { "/mgmt.MgmtSvc/PoolDeleteACL": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolExclude": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolDrain": {ComponentAdmin}, - "/mgmt.MgmtSvc/PoolReint": {ComponentAdmin}, + "/mgmt.MgmtSvc/PoolReintegrate": {ComponentAdmin}, "/mgmt.MgmtSvc/PoolEvict": {ComponentAdmin, ComponentAgent}, "/mgmt.MgmtSvc/PoolExtend": {ComponentAdmin}, "/mgmt.MgmtSvc/GetAttachInfo": {ComponentAgent}, diff --git a/src/control/server/mgmt_pool_test.go b/src/control/server/mgmt_pool_test.go index 0505279a7b4..a16955830f6 100644 --- a/src/control/server/mgmt_pool_test.go +++ b/src/control/server/mgmt_pool_test.go @@ -1,5 +1,6 @@ // // (C) Copyright 2020-2024 Intel Corporation. +// (C) Copyright 2025 Hewlett Packard Enterprise Development LP // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -1494,9 +1495,9 @@ func TestServer_MgmtSvc_PoolReintegrate(t *testing.T) { nilReq bool getMockDrpc func(error) *mockDrpcClient mgmtSvc *mgmtSvc - reqIn *mgmtpb.PoolReintegrateReq - drpcResp *mgmtpb.PoolReintegrateResp - expDrpcReq *mgmtpb.PoolReintegrateReq + reqIn *mgmtpb.PoolReintReq + drpcResp *mgmtpb.PoolReintResp + expDrpcReq *mgmtpb.PoolReintReq expErr error }{ "nil request": { @@ -1504,7 +1505,7 @@ func TestServer_MgmtSvc_PoolReintegrate(t *testing.T) { expErr: errors.New("nil request"), }, "wrong system": { - reqIn: &mgmtpb.PoolReintegrateReq{Id: mockUUID, Sys: "bad"}, + reqIn: &mgmtpb.PoolReintReq{Id: mockUUID, Sys: "bad"}, expErr: FaultWrongSystem("bad", build.DefaultSystemName), }, "missing superblock": { @@ -1528,13 +1529,13 @@ func TestServer_MgmtSvc_PoolReintegrate(t *testing.T) { expErr: errors.New("unmarshal"), }, "missing uuid": { - reqIn: &mgmtpb.PoolReintegrateReq{Rank: 1}, + reqIn: &mgmtpb.PoolReintReq{Rank: 1}, expErr: errors.New("empty pool id"), }, "successfully extended": { - drpcResp: &mgmtpb.PoolReintegrateResp{}, + drpcResp: &mgmtpb.PoolReintResp{}, // Expect that the last request contains updated params from ps entry. - expDrpcReq: &mgmtpb.PoolReintegrateReq{ + expDrpcReq: &mgmtpb.PoolReintReq{ Sys: build.DefaultSystemName, SvcRanks: mockSvcRanks, Id: mockUUID, @@ -1549,7 +1550,7 @@ func TestServer_MgmtSvc_PoolReintegrate(t *testing.T) { defer test.ShowBufferOnFailure(t, buf) if tc.reqIn == nil && !tc.nilReq { - tc.reqIn = &mgmtpb.PoolReintegrateReq{Id: mockUUID, Rank: 1} + tc.reqIn = &mgmtpb.PoolReintReq{Id: mockUUID, Rank: 1} } if tc.mgmtSvc == nil { tc.mgmtSvc = newTestMgmtSvc(t, log) @@ -1586,7 +1587,7 @@ func TestServer_MgmtSvc_PoolReintegrate(t *testing.T) { } // Check extend gets called with correct params from PS entry. - lastReq := new(mgmtpb.PoolReintegrateReq) + lastReq := new(mgmtpb.PoolReintReq) if err := proto.Unmarshal(getLastMockCall(mdc).Body, lastReq); err != nil { t.Fatal(err) }