From common-commits-return-83447-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Wed May 30 23:01:40 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6334F180771 for ; Wed, 30 May 2018 23:01:39 +0200 (CEST) Received: (qmail 85555 invoked by uid 500); 30 May 2018 21:01:30 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 84803 invoked by uid 99); 30 May 2018 21:01:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 May 2018 21:01:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20442E116C; Wed, 30 May 2018 21:01:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hanishakoneru@apache.org To: common-commits@hadoop.apache.org Date: Wed, 30 May 2018 21:01:50 -0000 Message-Id: <1e05910c25b84df792a8358156ec3f22@git.apache.org> In-Reply-To: <8e883cb562e44350b39c61eec0211dd7@git.apache.org> References: <8e883cb562e44350b39c61eec0211dd7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/50] [abbrv] hadoop git commit: HADOOP-15498. TestHadoopArchiveLogs (#testGenerateScript, #testPrepareWorkingDir) fails on Windows. Contributed by Anbang Hu. HADOOP-15498. TestHadoopArchiveLogs (#testGenerateScript, #testPrepareWorkingDir) fails on Windows. Contributed by Anbang Hu. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/75ae41ba Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/75ae41ba Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/75ae41ba Branch: refs/heads/HDDS-48 Commit: 75ae41ba89736a1916fb5158402cc0756e736b78 Parents: a2b3bde Author: Inigo Goiri Authored: Mon May 28 16:45:42 2018 -0700 Committer: Hanisha Koneru Committed: Wed May 30 14:00:25 2018 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/tools/TestHadoopArchiveLogs.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/75ae41ba/hadoop-tools/hadoop-archive-logs/src/test/java/org/apache/hadoop/tools/TestHadoopArchiveLogs.java ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-archive-logs/src/test/java/org/apache/hadoop/tools/TestHadoopArchiveLogs.java b/hadoop-tools/hadoop-archive-logs/src/test/java/org/apache/hadoop/tools/TestHadoopArchiveLogs.java index 2ddd4c5..a1b662c 100644 --- a/hadoop-tools/hadoop-archive-logs/src/test/java/org/apache/hadoop/tools/TestHadoopArchiveLogs.java +++ b/hadoop-tools/hadoop-archive-logs/src/test/java/org/apache/hadoop/tools/TestHadoopArchiveLogs.java @@ -25,6 +25,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsAction; import org.apache.hadoop.fs.permission.FsPermission; +import org.apache.hadoop.util.Shell; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; @@ -278,7 +279,7 @@ public class TestHadoopArchiveLogs { hal.generateScript(localScript); Assert.assertTrue(localScript.exists()); String script = IOUtils.toString(localScript.toURI()); - String[] lines = script.split(System.lineSeparator()); + String[] lines = script.split("\n"); Assert.assertEquals(22, lines.length); Assert.assertEquals("#!/bin/bash", lines[0]); Assert.assertEquals("set -e", lines[1]); @@ -368,7 +369,8 @@ public class TestHadoopArchiveLogs { Assert.assertTrue(dirPrepared); Assert.assertTrue(fs.exists(workingDir)); Assert.assertEquals( - new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, true), + new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, + !Shell.WINDOWS), fs.getFileStatus(workingDir).getPermission()); // Throw a file in the dir Path dummyFile = new Path(workingDir, "dummy.txt"); @@ -381,7 +383,8 @@ public class TestHadoopArchiveLogs { Assert.assertTrue(fs.exists(workingDir)); Assert.assertTrue(fs.exists(dummyFile)); Assert.assertEquals( - new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, true), + new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, + !Shell.WINDOWS), fs.getFileStatus(workingDir).getPermission()); // -force is true and the dir exists, so it will recreate it and the dummy // won't exist anymore @@ -390,7 +393,8 @@ public class TestHadoopArchiveLogs { Assert.assertTrue(dirPrepared); Assert.assertTrue(fs.exists(workingDir)); Assert.assertEquals( - new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, true), + new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL, + !Shell.WINDOWS), fs.getFileStatus(workingDir).getPermission()); Assert.assertFalse(fs.exists(dummyFile)); } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org