@Test (timeout=60000)
public void testUpdateDirectory() throws Exception {

  Path dir = new Path("/dir");
  Path sub = new Path(dir, "sub");
  Path subFile = new Path(sub, "file");
  DFSTestUtil.createFile(hdfs, subFile, BLOCKSIZE, REPLICATION, seed);
  FileStatus oldStatus = hdfs.getFileStatus(sub);
  hdfs.allowSnapshot(dir);
  hdfs.createSnapshot(dir, "s1");
  hdfs.setTimes(sub, 100L, 100L);
  Path snapshotPath = SnapshotTestHelper.getSnapshotPath(dir, "s1", "sub");
  FileStatus snapshotStatus = hdfs.getFileStatus(snapshotPath);
  assertEquals(oldStatus.getModificationTime(),
      snapshotStatus.getModificationTime());
  assertEquals(oldStatus.getAccessTime(), snapshotStatus.getAccessTime());
}