[ 
https://issues.apache.org/jira/browse/HDFS-13001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358068#comment-16358068
 ] 

Jianfei Jiang commented on HDFS-13001:
--------------------------------------

hi [~brahmareddy],

The testcase for DFSAdmin command has been updated as mentioned in HDFS-12935. 
Please review and give your advice. Thank you. 

I will fix the checkstyle and add patch for branch-2 if the way I fixed is 
appropriate.

> Testcase improvement for DFSAdmin
> ---------------------------------
>
>                 Key: HDFS-13001
>                 URL: https://issues.apache.org/jira/browse/HDFS-13001
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: tools
>    Affects Versions: 2.9.0, 3.0.0
>            Reporter: Jianfei Jiang
>            Assignee: Jianfei Jiang
>            Priority: Minor
>         Attachments: HDFS-13001.001.patch, HDFS-13001.002.patch
>
>
> Testcase improvement for DFSAdmin command. The commands should be tested 
> under following environments:
> (1) Both Namenode are up online
> (2) NN1 is off offline and NN2 is up online
> (3) NN1 is up online and NN2 is down offline
> (4) Both Namenode are down offline
> The testcases can be improved.
> Testcases can be improved like code below.
> {code:java}
>   private void testExecuteDFSAdminCommand(int nnIndex, String[] command,
>       String message) throws Exception {
>     setUpHaCluster(false);
>     switch (nnIndex) {
>       case 0:
>         cluster.getDfsCluster().shutdownNameNode(0);
>         cluster.getDfsCluster().transitionToActive(1);
>         break;
>       case 1:
>         cluster.getDfsCluster().shutdownNameNode(1);
>         cluster.getDfsCluster().transitionToActive(0);
>         break;
>       case 2:
>         cluster.getDfsCluster().shutdownNameNode(0);
>         cluster.getDfsCluster().shutdownNameNode(1);
>         break;
>       default:
>     }
>     int exitCode = admin.run(command);
>     if (nnIndex != 2) {
>       assertEquals(err.toString().trim(), 0, exitCode);
>       assertOutputMatches(message + newLine);
>     } else {
>       assertNotEquals(err.toString().trim(), 0, exitCode);
>       assertOutputNotMatches(message + newLine);
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to