From hdfs-dev-return-31264-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Jan 9 11:46:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id A922918072F for ; Tue, 9 Jan 2018 11:46:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 997DF160C13; Tue, 9 Jan 2018 10:46:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E0354160C2D for ; Tue, 9 Jan 2018 11:46:04 +0100 (CET) Received: (qmail 80572 invoked by uid 500); 9 Jan 2018 10:46:03 -0000 Mailing-List: contact hdfs-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-dev@hadoop.apache.org Received: (qmail 80275 invoked by uid 99); 9 Jan 2018 10:46:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2018 10:46:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2AB15C1E4A for ; Tue, 9 Jan 2018 10:46:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.711 X-Spam-Level: X-Spam-Status: No, score=-100.711 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id CcBYDca4-qrf for ; Tue, 9 Jan 2018 10:46:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E12955F343 for ; Tue, 9 Jan 2018 10:46:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1A125E039B for ; Tue, 9 Jan 2018 10:46:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 420B1240F6 for ; Tue, 9 Jan 2018 10:46:00 +0000 (UTC) Date: Tue, 9 Jan 2018 10:46:00 +0000 (UTC) From: "Jianfei Jiang (JIRA)" To: hdfs-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HDFS-13001) Testcase improvement for DFSAdmin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Jianfei Jiang created HDFS-13001: ------------------------------------ Summary: Testcase improvement for DFSAdmin Key: HDFS-13001 URL: https://issues.apache.org/jira/browse/HDFS-13001 Project: Hadoop HDFS Issue Type: Sub-task Affects Versions: 3.0.0, 2.9.0 Reporter: Jianfei Jiang Assignee: Jianfei Jiang Priority: Minor 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 (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org