You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by co...@apache.org on 2014/04/25 01:05:35 UTC
[26/50] git commit: Edit pom and added Slivetest draft
Edit pom and added Slivetest draft
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/8a115cf6
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/8a115cf6
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/8a115cf6
Branch: refs/heads/master
Commit: 8a115cf6331a96a0b09eeded14f45f2ba53bf3d9
Parents: b4c14e7
Author: Virginia Wang <vi...@wandisco.com>
Authored: Wed Feb 5 11:05:34 2014 -0800
Committer: Virginia Wang <vi...@wandisco.com>
Committed: Wed Feb 5 11:05:34 2014 -0800
----------------------------------------------------------------------
.../bigtop/itest/iolongevity/TestSLive.groovy | 59 ++++++++++++++++++++
.../test-execution/longevity/io/pom.xml | 2 +-
2 files changed, 60 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bigtop/blob/8a115cf6/bigtop-tests/test-artifacts/longevity/src/main/groovy/org/apache/bigtop/itest/iolongevity/TestSLive.groovy
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/longevity/src/main/groovy/org/apache/bigtop/itest/iolongevity/TestSLive.groovy b/bigtop-tests/test-artifacts/longevity/src/main/groovy/org/apache/bigtop/itest/iolongevity/TestSLive.groovy
new file mode 100644
index 0000000..7b434c7
--- /dev/null
+++ b/bigtop-tests/test-artifacts/longevity/src/main/groovy/org/apache/bigtop/itest/iolongevity/TestSLive.groovy
@@ -0,0 +1,59 @@
+package org.apache.bigtop.itest.iolongevity
+
+import org.apache.bigtop.itest.shell.Shell
+import org.junit.BeforeClass
+import org.junit.Test
+import static org.apache.bigtop.itest.LogErrorsUtils.logError
+import static org.junit.Assert.assertTrue
+
+
+public class TestSLive {
+ static Shell sh = new Shell("/bin/bash -s");
+ private static final String SLIVE_OUTPUT_FILE = "/test/slive/slive/output";
+ static String[] sliveCmds;
+
+
+ @BeforeClass
+ static void setUp() throws IOException {
+ String numSliveFiles = "1000000";
+ String mapredClientJar = System.getProperty("mapredClientTestJar", "/usr/lib/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-*-tests*.jar");
+ String SLIVE_TEMPLATE = "hadoop jar %s SliveTest -create %s -delete %s -rename %s -read %s -append %s -ls %s -mkdir %s -files %s -resFile %s";
+
+ sliveCmds = [
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 100, 0, 0, 0, 0, 0, 0, numSliveFiles, "sliveOutputcreate.txt"), //create
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 0, 0, 0, 100, 0, 0, 0, numSliveFiles, "sliveOutputread.txt"), //read
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 0, 0, 0, 0, 100, 0, 0, numSliveFiles, "sliveOutputappend.txt"), //append
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 0, 0, 0, 0, 0, 100, 0, numSliveFiles, "sliveOutputls.txt"), //ls
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 0, 0, 100, 0, 0, 0, 0, numSliveFiles, "sliveOutputrename.txt"), //rename
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 0, 100, 0, 0, 0, 0, 0, numSliveFiles, "sliveOutputdelete.txt"), //delete
+ String.format(SLIVE_TEMPLATE, mapredClientJar, 20, 0, 20, 20, 0, 20, 20, numSliveFiles, "sliveOutputmix.txt") //mix
+ ]
+
+ }
+
+ public void cleanup() {
+ sh.exec("hadoop fs -rm -r " + SLIVE_OUTPUT_FILE)
+ Thread.sleep(5000)
+ }
+
+ @Test
+ public void testSlive() {
+ for (cmd in sliveCmds) {
+ sh.exec(cmd)
+ logError(sh)
+ assertTrue(sh.getRet() == 0)
+ String expectedFile = SLIVE_OUTPUT_FILE + "/_SUCCESS"
+ sh.exec("hadoop fs -ls " + expectedFile);
+ boolean success = false;
+ for (String str : sh.getOut()) {
+ if (str.contains(expectedFile)) {
+ success = true;
+ }
+ }
+ assertTrue(success);
+ cleanup();
+ }
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/bigtop/blob/8a115cf6/bigtop-tests/test-execution/longevity/io/pom.xml
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-execution/longevity/io/pom.xml b/bigtop-tests/test-execution/longevity/io/pom.xml
index 4a56ea2..fa60730 100644
--- a/bigtop-tests/test-execution/longevity/io/pom.xml
+++ b/bigtop-tests/test-execution/longevity/io/pom.xml
@@ -35,7 +35,7 @@
<properties>
<!--Additional environment variables are required-->
<HADOOP_HOME>${env.HADOOP_HOME}</HADOOP_HOME>
- <HADOOP_CONF_DIR>${env.HADOOP_CONF)DIR}</HADOOP_CONF_DIR>
+ <HADOOP_CONF_DIR>${env.HADOOP_CONF_DIR}</HADOOP_CONF_DIR>
<!-- Integration tests are special -->
<org.apache.maven-failsafe-plugin.testInclude>**/LongevityTest*</org.apache.maven-failsafe-plugin.testInclude>
<org.apache.maven-dependency-plugin.groupId>org.apache.bigtop.itest</org.apache.maven-dependency-plugin.groupId>