Skip to content

Commit

Permalink
more naming reverts
Browse files Browse the repository at this point in the history
Features: control
Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Jan 7, 2025
1 parent 28ff297 commit eb683e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/control/security/grpc_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion src/control/security/grpc_authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
19 changes: 10 additions & 9 deletions src/control/server/mgmt_pool_test.go
Original file line number Diff line number Diff line change
@@ -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
//
Expand Down Expand Up @@ -1494,17 +1495,17 @@ 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": {
nilReq: true,
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": {
Expand All @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit eb683e9

Please sign in to comment.