You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by bm...@apache.org on 2012/06/05 21:20:54 UTC
svn commit: r1346541 - in /incubator/bigtop/trunk:
bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/
bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/
bigtop-tests/test-artifacts/hadoop/src/main/groovy...
Author: bmahe
Date: Tue Jun 5 19:20:54 2012
New Revision: 1346541
URL: http://svn.apache.org/viewvc?rev=1346541&view=rev
Log:
BIGTOP-610. Add basic hdfs fsck test and move logError helper to bigtop-test-framework (Stephen Chu via Bruno Mahé)
Added:
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/LogErrorsUtils.groovy
incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadooptests/TestFsck.groovy
Modified:
incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/TestHadoopSmoke.groovy
Added: incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/LogErrorsUtils.groovy
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/LogErrorsUtils.groovy?rev=1346541&view=auto
==============================================================================
--- incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/LogErrorsUtils.groovy (added)
+++ incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/LogErrorsUtils.groovy Tue Jun 5 19:20:54 2012
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bigtop.itest
+
+import org.apache.bigtop.itest.shell.Shell
+
+public class LogErrorsUtils {
+
+ static void logError (final Shell sh) {
+ if (sh.getRet()) {
+ println ('Failed command: ' + sh.script);
+ println ('\terror code: ' + sh.getRet());
+ println ('\tstdout: ' + sh.getOut());
+ println ('\tstderr: ' + sh.getErr());
+ }
+ }
+
+}
Modified: incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/TestHadoopSmoke.groovy
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/TestHadoopSmoke.groovy?rev=1346541&r1=1346540&r2=1346541&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/TestHadoopSmoke.groovy (original)
+++ incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoopsmoke/TestHadoopSmoke.groovy Tue Jun 5 19:20:54 2012
@@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.hdfs.DFSConfigKeys
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertNotNull
+import static org.apache.bigtop.itest.LogErrorsUtils.logError
class TestHadoopSmoke {
static Shell sh = new Shell("/bin/bash -s")
@@ -89,12 +90,4 @@ class TestHadoopSmoke {
assertEquals("cache1\t\ncache2\t", sh.out.join('\n'))
}
- private static void logError (final Shell sh) {
- if (sh.getRet()) {
- println ('Failed command: ' + sh.script);
- println ('\terror code: ' + sh.getRet());
- println ('\tstdout: ' + sh.getOut());
- println ('\tstderr: ' + sh.getErr());
- }
- }
}
Added: incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadooptests/TestFsck.groovy
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadooptests/TestFsck.groovy?rev=1346541&view=auto
==============================================================================
--- incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadooptests/TestFsck.groovy (added)
+++ incubator/bigtop/trunk/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadooptests/TestFsck.groovy Tue Jun 5 19:20:54 2012
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.bigtop.itest.hadooptests
+
+import org.junit.Test
+import org.apache.bigtop.itest.shell.Shell
+import static org.junit.Assert.assertTrue
+import static org.apache.bigtop.itest.LogErrorsUtils.logError
+
+/**
+ * Tests the HDFS fsck command.
+ */
+public class TestFsck {
+ static Shell sh = new Shell("/bin/bash -s")
+ static final String fsck_cmd = "hdfs fsck /"
+
+ @Test
+ public void testFsckBasic() {
+ sh.exec(fsck_cmd)
+ logError(sh)
+ assertTrue(sh.getRet() == 0)
+ }
+
+}