You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by br...@apache.org on 2013/03/14 18:01:24 UTC
git commit: FLUME-1943: ExecSource tests failing on Jenkins
Updated Branches:
refs/heads/trunk 9204456ee -> 84fbbdecf
FLUME-1943: ExecSource tests failing on Jenkins
(Roshan Naik via Brock Noland)
Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/84fbbdec
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/84fbbdec
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/84fbbdec
Branch: refs/heads/trunk
Commit: 84fbbdecf95db1a88245f57eae0c4086ecca96ed
Parents: 9204456
Author: Brock Noland <br...@apache.org>
Authored: Thu Mar 14 12:00:59 2013 -0500
Committer: Brock Noland <br...@apache.org>
Committed: Thu Mar 14 12:00:59 2013 -0500
----------------------------------------------------------------------
.../org/apache/flume/source/TestExecSource.java | 23 ++++++++------
1 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flume/blob/84fbbdec/flume-ng-core/src/test/java/org/apache/flume/source/TestExecSource.java
----------------------------------------------------------------------
diff --git a/flume-ng-core/src/test/java/org/apache/flume/source/TestExecSource.java b/flume-ng-core/src/test/java/org/apache/flume/source/TestExecSource.java
index 7c573f6..3d524f0 100644
--- a/flume-ng-core/src/test/java/org/apache/flume/source/TestExecSource.java
+++ b/flume-ng-core/src/test/java/org/apache/flume/source/TestExecSource.java
@@ -111,7 +111,7 @@ public class TestExecSource {
@Test
public void testShellCommandSimple() throws InterruptedException, LifecycleException,
EventDeliveryException, IOException {
- runTestShellCmdHelper("/bin/sh -c", "seq 5"
+ runTestShellCmdHelper("/bin/bash -c", "seq 5"
, new String[]{"1","2","3","4","5" } );
}
@@ -119,8 +119,8 @@ public class TestExecSource {
public void testShellCommandBackTicks() throws InterruptedException, LifecycleException,
EventDeliveryException, IOException {
// command with backticks
- runTestShellCmdHelper("/bin/sh -c", "echo `seq 5`" , new String[]{"1 2 3 4 5" } );
- runTestShellCmdHelper("/bin/sh -c", "echo $(seq 5)" , new String[]{"1 2 3 4 5" } );
+ runTestShellCmdHelper("/bin/bash -c", "echo `seq 5`" , new String[]{"1 2 3 4 5" } );
+ runTestShellCmdHelper("/bin/bash -c", "echo $(seq 5)" , new String[]{"1 2 3 4 5" } );
}
@Test
@@ -130,7 +130,7 @@ public class TestExecSource {
String[] expected = {"1234", "abcd", "ijk", "xyz", "zzz"};
// pipes
- runTestShellCmdHelper("/bin/sh -c", "echo zzz 1234 xyz abcd ijk | xargs -n1 echo | sort -f"
+ runTestShellCmdHelper("/bin/bash -c", "echo zzz 1234 xyz abcd ijk | xargs -n1 echo | sort -f"
, expected );
}
@@ -138,10 +138,10 @@ public class TestExecSource {
public void testShellCommandScript() throws InterruptedException, LifecycleException,
EventDeliveryException, IOException {
// mini script
- runTestShellCmdHelper("/bin/sh -c", "for i in {1..5}; do echo $i;done"
+ runTestShellCmdHelper("/bin/bash -c", "for i in {1..5}; do echo $i;done"
, new String[]{"1","2","3","4","5" } );
// shell arithmetic
- runTestShellCmdHelper("/bin/sh -c", "if ((2+2>3)); then echo good; else echo not good; fi" , new String[]{"good"} );
+ runTestShellCmdHelper("/bin/bash -c", "if ((2+2>3)); then echo good; else echo not good; fi" , new String[]{"good"} );
}
@Test
@@ -154,15 +154,15 @@ public class TestExecSource {
String command1 = reader.readLine();
Assert.assertNotNull(command1);
String[] output1 = new String[] {"'1'", "\"2\"", "\\3", "\\4"};
- runTestShellCmdHelper("/bin/sh -c", command1 , output1);
+ runTestShellCmdHelper("/bin/bash -c", command1 , output1);
String command2 = reader.readLine();
Assert.assertNotNull(command2);
String[] output2 = new String[]{"1","2","3","4","5" };
- runTestShellCmdHelper("/bin/sh -c", command2 , output2);
+ runTestShellCmdHelper("/bin/bash -c", command2 , output2);
String command3 = reader.readLine();
Assert.assertNotNull(command3);
String[] output3 = new String[]{"2","3","4","5","6" };
- runTestShellCmdHelper("/bin/sh -c", command3 , output3);
+ runTestShellCmdHelper("/bin/bash -c", command3 , output3);
} finally {
reader.close();
}
@@ -188,7 +188,10 @@ public class TestExecSource {
outputStream.close();
transaction.commit();
List<String> output = Files.readLines(outputFile, Charset.defaultCharset());
-
+ System.out.println("command : " + command);
+ System.out.println("output : ");
+ for( String line : output )
+ System.out.println();
Assert.assertArrayEquals(expectedOutput, output.toArray(new String[]{}));
} finally {
FileUtils.forceDelete(outputFile);