From 1813fb0132f017441379a29b2d4d40a44eb08430 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Thu, 8 Nov 2012 19:12:42 +0000 Subject: [PATCH] HADOOP-8974. TestDFVariations fails on Windows. Contributed by Chris Nauroth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1407222 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 5 ++++- .../test/java/org/apache/hadoop/fs/TestDFVariations.java | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index db09a93efa..4d6b88c93d 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -272,7 +272,10 @@ Trunk (Unreleased) HADOOP-8918. test-patch.sh is parsing modified files wrong. (Raja Aluri via suresh) - HADOOP-8589 ViewFs tests fail when tests and home dirs are nested (sanjay Radia) + HADOOP-8589 ViewFs tests fail when tests and home dirs are nested. + (sanjay Radia) + + HADOOP-8974. TestDFVariations fails on Windows. (Chris Nauroth via suresh) OPTIMIZATIONS diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDFVariations.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDFVariations.java index b5bd65bc1a..b291dd2200 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDFVariations.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDFVariations.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.util.EnumSet; +import org.apache.hadoop.util.Shell; + public class TestDFVariations extends TestCase { public static class XXDF extends DF { @@ -51,7 +53,9 @@ protected String[] getExecString() { public void testOSParsing() throws Exception { for (DF.OSType ost : EnumSet.allOf(DF.OSType.class)) { XXDF df = new XXDF(ost.getId()); - assertEquals(ost.getId() + " mount", "/foo/bar", df.getMount()); + assertEquals(ost.getId() + " mount", + Shell.WINDOWS ? df.getDirPath().substring(0, 2) : "/foo/bar", + df.getMount()); } }