Skip to content

Commit

Permalink
HDDS-8966. Replace test-specific unknown value with real one (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Jun 30, 2023
1 parent 59a7b65 commit 53ba990
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ public static boolean isReadOnly(
case SnapshotPurge:
case RecoverLease:
case SetTimes:
case UnknownCommand:
return false;
default:
LOG.error("CmdType {} is not categorized as readOnly or not.", cmdType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void testUnknownRequestHandling() throws IOException,
// Create an instance of OMRequest with an unknown command type.
OzoneManagerProtocolProtos.OMRequest omRequest =
OzoneManagerProtocolProtos.OMRequest.newBuilder()
.setCmdType(OzoneManagerProtocolProtos.Type.TestUnknownCommand)
.setCmdType(OzoneManagerProtocolProtos.Type.UnknownCommand)
.setClientId("test-client-id")
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import "hdds.proto";
import "Security.proto";

enum Type {
UnknownCommand = 0;
CreateVolume = 11;
SetVolumeProperty = 12;
CheckVolumeAccess = 13;
Expand Down Expand Up @@ -138,7 +139,6 @@ enum Type {
RefetchSecretKey = 121;
ListSnapshotDiffJobs = 122;
CancelSnapshotDiff = 123;
TestUnknownCommand = 124;
}

message OMRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ public void testIsReadOnlyCapturesAllCmdTypeEnums() throws Exception {
OzoneManagerProtocolProtos.Type.values();

for (OzoneManagerProtocolProtos.Type cmdtype : cmdTypes) {
if (cmdtype == OzoneManagerProtocolProtos.Type.TestUnknownCommand) {
// Skip OzoneManagerProtocolProtos.Type.TestUnknownCommand, since this
// cmdType is reserved for testing purposes only.
continue;
}
OMRequest request = OMRequest.newBuilder()
.setCmdType(cmdtype)
.setClientId(clientId)
Expand Down

0 comments on commit 53ba990

Please sign in to comment.