[ https://issues.apache.org/jira/browse/HDFS-10972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15556745#comment-15556745 ]
Mingliang Liu commented on HDFS-10972: -------------------------------------- # We don't have to call {{restoreStream()}} in {{testGetDatanodeInfo}} if it's already called in {{tearDown}}. Actually we can remove this method and inline its code in {{tearDown}}. # I think we can still collect the out instead of err, and assert that the outs is empty. We don't have to assert on specific error message as it is free to change in the future. Asserting the ret value being -1 is enough. {code} 203 /* collect outputs */ 204 scanIntoList(err, outs); 205 206 /* verify results */ 207 assertEquals(-1, ret); 208 assertEquals( 209 "expect to see 'Datanode unreachable.'", 210 1, outs.size()); 211 assertThat(outs.get(0), containsString("Datanode unreachable")); {code} Something like following: {code} 203 /* collect outputs */ 204 scanIntoList(out, outs); 205 206 /* verify results */ 207 assertEquals(-1, ret); 208 assertTrue("Unexpected getDatanodeInfo stdout", outs.isEmpty()); {code} > Add unit test for HDFS command 'dfsadmin -getDatanodeInfo' > ---------------------------------------------------------- > > Key: HDFS-10972 > URL: https://issues.apache.org/jira/browse/HDFS-10972 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: fs, shell, test > Reporter: Xiaobing Zhou > Assignee: Xiaobing Zhou > Attachments: HDFS-10972.000.patch, HDFS-10972.001.patch, > HDFS-10972.002.patch > > > getDatanodeInfo should be tested in admin CLI. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org