@Override
  public IOStreamPair execContainer(ContainerExecContext ctx)
      throws ContainerExecutionException {
    IOStreamPair res;
    try {
      res = linuxContainerRuntime.execContainer(ctx);
    } catch (ContainerExecutionException e) {
      int retCode = e.getExitCode();
      if (retCode != 0) {
        return new IOStreamPair(null, null);
      }
      LOG.warn("Error in executing container interactive shell {} exit = {}",
          ctx, retCode, e);
      logOutput(e.getOutput());
      throw new ContainerExecutionException(
          "Error in executing container interactive shel" + ctx.getContainer()
          .getContainerId().toString() + " exit = " + retCode);
    }
    return res;
  }
@Test
  public void testExecContainer() throws Exception {
    Container container = mock(Container.class);
    LinuxContainerExecutor lce = mock(LinuxContainerExecutor.class);
    ContainerExecContext.Builder builder =
        new ContainerExecContext.Builder();
    builder.setUser("foo").setAppId("app1").setContainer(container);
    ContainerExecContext ctx = builder.build();
    lce.execContainer(ctx);
    verify(lce, times(1)).execContainer(ctx);
  }