KDiag extends Configured implements Tool, Closeable { @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") public KDiag(Configuration conf, PrintWriter out, File keytab, String principal, long minKeyLength, boolean securityRequired) { super(conf); this.keytab = keytab; this.principal = principal; this.out = out; this.minKeyLength = minKeyLength; this.securityRequired = securityRequired; } @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")  KDiag(Configuration conf,
      PrintWriter out,
      File keytab,
      String principal,
      long minKeyLength,
      boolean securityRequired);  KDiag(); @Override void close(); @Override int run(String[] argv); @SuppressWarnings("deprecation") boolean execute(); void dumpTokens(UserGroupInformation ugi); static int exec(Configuration conf, String... argv); static void main(String[] argv); static final String KRB5_CCNAME; static final String KRB5_CONFIG; static final String JAVA_SECURITY_KRB5_CONF; static final String JAVA_SECURITY_KRB5_REALM; static final String JAVA_SECURITY_KRB5_KDC_ADDRESS; static final String SUN_SECURITY_KRB5_DEBUG; static final String SUN_SECURITY_SPNEGO_DEBUG; static final String SUN_SECURITY_JAAS_FILE; static final String KERBEROS_KINIT_COMMAND; static final String HADOOP_AUTHENTICATION_IS_DISABLED; static final String UNSET; static final String NO_DEFAULT_REALM; static final int KDIAG_FAILURE; static final String DFS_DATA_TRANSFER_SASLPROPERTIES_RESOLVER_CLASS; static final String DFS_DATA_TRANSFER_PROTECTION; static final String ETC_KRB5_CONF; static final String ETC_NTP; static final String HADOOP_JAAS_DEBUG; static final String CAT_CONFIG; static final String CAT_JAAS; static final String CAT_JVM; static final String CAT_KERBEROS; static final String CAT_LOGIN; static final String CAT_OS; static final String CAT_SASL; static final String CAT_UGI; static final String CAT_TOKEN; static final String ARG_KEYLEN; static final String ARG_KEYTAB; static final String ARG_JAAS; static final String ARG_NOFAIL; static final String ARG_NOLOGIN; static final String ARG_OUTPUT; static final String ARG_PRINCIPAL; static final String ARG_RESOURCE; static final String ARG_SECURE; static final String ARG_VERIFYSHORTNAME; }
@Test public void testKeytabAndPrincipal() throws Throwable { kdiag(ARG_KEYLEN, KEYLEN, ARG_KEYTAB, keytab.getAbsolutePath(), ARG_PRINCIPAL, "foo@EXAMPLE.COM"); }
@Test public void testShortName() throws Throwable { kdiag(ARG_KEYLEN, KEYLEN, ARG_KEYTAB, keytab.getAbsolutePath(), ARG_PRINCIPAL, ARG_VERIFYSHORTNAME, ARG_PRINCIPAL, "foo@EXAMPLE.COM"); }
@Test public void testLoadResource() throws Throwable { kdiag(ARG_KEYLEN, KEYLEN, ARG_RESOURCE, HDFS_SITE_XML, ARG_KEYTAB, keytab.getAbsolutePath(), ARG_PRINCIPAL, "foo@EXAMPLE.COM"); }