static DistributedFileSystem createDfs(final Configuration conf) throws IOException {
    final String proxyUser = conf.get(HDFS_USER_CONF_KEY);
    if (proxyUser == null) {
      return createUnproxiedDfs(conf);
    }
    final UserGroupInformation proxyUgi =
      UserGroupInformation.createProxyUser(proxyUser, UserGroupInformation.getLoginUser());
    try {
      return proxyUgi
        .doAs((PrivilegedExceptionAction<DistributedFileSystem>) () -> createUnproxiedDfs(conf));
    } catch (InterruptedException e) {
      final InterruptedIOException iioe = new InterruptedIOException(e.getMessage());
      iioe.setStackTrace(e.getStackTrace());
      throw iioe;
    }
  }
Create an instance of {@link DistributedFileSystem} that honors {@value HDFS_USER_CONF_KEY}.
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/HdfsActionUtils.java