HADOOP-10017. Fix NPE in DFSClient#getDelegationToken when doing Distcp from a secured cluster to an insecured cluster. Contributed by Haohui Mai.
@@ -113,6 +113,19 @@ private HdfsConfiguration getTestConfiguration() {
return conf;
}
+ @Test
+ public void testEmptyDelegationToken() throws IOException {
+ Configuration conf = getTestConfiguration();
+ MiniDFSCluster cluster = null;
+ try {
+ cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
+ FileSystem fileSys = cluster.getFileSystem();
+ fileSys.getDelegationToken("");
+ } finally {
+ cluster.shutdown();
+ }
+ }
+
@Test
public void testFileSystemCloseAll() throws Exception {
Configuration conf = getTestConfiguration();
