@Test(timeout = 30000)
public void testDisableWrite() throws Exception {

  String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
  DistributedFileSystem fs =
      (DistributedFileSystem) FileSystem.get(URI.create(nnUri), conf);
  createFiles(fs, testRoot, srcfiles);
  Path src = new Path(testRoot, SRCDAT);
  Path dst = new Path(testRoot, DSTDAT);
  FedBalanceContext context = buildContext(src, dst, MOUNT);
  DistCpProcedure dcProcedure =
      new DistCpProcedure("distcp-procedure", null, 1000, context);
  assertNotEquals(0, fs.getFileStatus(src).getPermission().toShort());
  executeProcedure(dcProcedure, Stage.FINAL_DISTCP,
      () -> dcProcedure.disableWrite());
  assertEquals(0, fs.getFileStatus(src).getPermission().toShort());
  cleanup(fs, new Path(testRoot));
}