Skip to content

Commit

Permalink
HDDS-1998. TestSecureContainerServer#testClientServerRatisGrpc is fai…
Browse files Browse the repository at this point in the history
…ling (#1328)
  • Loading branch information
pingsutw authored and bshashikant committed Aug 27, 2019
1 parent b69ac57 commit 3329257
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.hadoop.ozone.container.server;

import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.hadoop.hdds.HddsConfigKeys;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
Expand Down Expand Up @@ -72,14 +73,14 @@
import java.util.Set;

import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_BLOCK_TOKEN_ENABLED;
import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.BLOCK_TOKEN_VERIFICATION_FAILED;
import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.SUCCESS;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_SECURITY_ENABLED_KEY;
import static org.apache.hadoop.ozone.container.ContainerTestHelper.getCreateContainerRequest;
import static org.apache.hadoop.ozone.container.ContainerTestHelper.getTestContainerID;
import static org.apache.ratis.rpc.SupportedRpcType.GRPC;
import static org.apache.ratis.rpc.SupportedRpcType.NETTY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
* Test Container servers when security is enabled.
Expand Down Expand Up @@ -202,9 +203,11 @@ static void runTestClientServer(
" authenticate with GRPC XceiverServer with Ozone block token",
() -> finalClient.sendCommand(request));
} else {
ContainerCommandResponseProto response = finalClient.
sendCommand(request);
assertEquals(BLOCK_TOKEN_VERIFICATION_FAILED, response.getResult());
IOException e = LambdaTestUtils.intercept(IOException.class,
() -> finalClient.sendCommand(request));
Throwable rootCause = ExceptionUtils.getRootCause(e);
String msg = rootCause.getMessage();
assertTrue(msg, msg.contains("Block token verification failed"));
}

// Test 2: Test success in request with valid block token.
Expand Down

0 comments on commit 3329257

Please sign in to comment.