|
@@ -122,6 +122,30 @@ public class TestContainerStateManagerIntegration {
|
|
|
Assert.assertEquals(3, numContainers);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testAllocateContainerWithDifferentOwner() throws IOException {
|
|
|
+
|
|
|
+ // Allocate a container and verify the container info
|
|
|
+ ContainerWithPipeline container1 = scm.getClientProtocolServer()
|
|
|
+ .allocateContainer(xceiverClientManager.getType(),
|
|
|
+ xceiverClientManager.getFactor(), containerOwner);
|
|
|
+ ContainerInfo info = containerManager
|
|
|
+ .getMatchingContainer(OzoneConsts.GB * 3, containerOwner,
|
|
|
+ container1.getPipeline());
|
|
|
+ Assert.assertNotNull(info);
|
|
|
+
|
|
|
+ String newContainerOwner = "OZONE_NEW";
|
|
|
+ ContainerWithPipeline container2 = scm.getClientProtocolServer()
|
|
|
+ .allocateContainer(xceiverClientManager.getType(),
|
|
|
+ xceiverClientManager.getFactor(), newContainerOwner);
|
|
|
+ ContainerInfo info2 = containerManager
|
|
|
+ .getMatchingContainer(OzoneConsts.GB * 3, newContainerOwner,
|
|
|
+ container1.getPipeline());
|
|
|
+ Assert.assertNotNull(info2);
|
|
|
+
|
|
|
+ Assert.assertNotEquals(info.containerID(), info2.containerID());
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testContainerStateManagerRestart() throws IOException,
|
|
|
TimeoutException, InterruptedException, AuthenticationException {
|