From 18a4cb4872f2529edbc34414d8a0b57b3e6b5bb9 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Sun, 16 Jun 2013 03:30:05 +0000 Subject: [PATCH] HADOOP-9632. TestShellCommandFencer will fail if there is a 'host' machine in the network. Contributed by Chuan Liu. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1493451 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../org/apache/hadoop/ha/TestShellCommandFencer.java | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index b0eb86f24bd..3bb966503b8 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -585,6 +585,9 @@ Release 2.1.0-beta - UNRELEASED HADOOP-9638. Parallel test changes caused invalid test path for several HDFS tests on Windows (Andrey Klochkov via cnauroth) + HADOOP-9632. TestShellCommandFencer will fail if there is a 'host' machine in + the network. (Chuan Liu via cnauroth) + BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS HADOOP-8924. Hadoop Common creating package-info.java must not depend on diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestShellCommandFencer.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestShellCommandFencer.java index 8a652b5b95e..6750b3b424e 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestShellCommandFencer.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestShellCommandFencer.java @@ -36,7 +36,7 @@ public class TestShellCommandFencer { private ShellCommandFencer fencer = createFencer(); private static final HAServiceTarget TEST_TARGET = new DummyHAService(HAServiceState.ACTIVE, - new InetSocketAddress("host", 1234)); + new InetSocketAddress("dummyhost", 1234)); @BeforeClass public static void setupLogSpy() { @@ -140,13 +140,13 @@ public class TestShellCommandFencer { @Test public void testTargetAsEnvironment() { if (!Shell.WINDOWS) { - fencer.tryFence(TEST_TARGET, "echo $target_host $target_port $target_address"); + fencer.tryFence(TEST_TARGET, "echo $target_host $target_port"); Mockito.verify(ShellCommandFencer.LOG).info( - Mockito.endsWith("echo $ta...t_address: host 1234 host:1234")); + Mockito.endsWith("echo $ta...rget_port: dummyhost 1234")); } else { - fencer.tryFence(TEST_TARGET, "echo %target_host% %target_port% %target_address%"); + fencer.tryFence(TEST_TARGET, "echo %target_host% %target_port%"); Mockito.verify(ShellCommandFencer.LOG).info( - Mockito.endsWith("echo %ta..._address%: host 1234 host:1234")); + Mockito.endsWith("echo %ta...get_port%: dummyhost 1234")); } }