diff options
author | Konstantin Boudnik <cos@boudnik.org> | 2016-03-02 13:08:19 +0300 |
---|---|---|
committer | Roman Shaposhnik <rvs@apache.org> | 2017-03-23 10:26:57 -0700 |
commit | 73ecdca484ffbfe1f6da7736553fd13c9996e6f9 (patch) | |
tree | 1571270837569a40653e871cb22104601c183831 /bigtop-tests/spec-tests | |
parent | a438bec98a2f694dc33fddfd46c2557858cd9772 (diff) |
ODPI-30. Write iTest tests for validating ODPi spec compliance
Fix HADOOP_TOOLS test.
(cherry picked from commit 83a851f8386196f2b6421346afb7e87e94577b73)
Diffstat (limited to 'bigtop-tests/spec-tests')
-rw-r--r-- | bigtop-tests/spec-tests/runtime/src/test/groovy/org/odpi/specs/runtime/TestSpecsRuntime.groovy | 18 | ||||
-rw-r--r-- | bigtop-tests/spec-tests/runtime/src/test/resources/testRuntimeSpecConf.groovy | 1 |
2 files changed, 10 insertions, 9 deletions
diff --git a/bigtop-tests/spec-tests/runtime/src/test/groovy/org/odpi/specs/runtime/TestSpecsRuntime.groovy b/bigtop-tests/spec-tests/runtime/src/test/groovy/org/odpi/specs/runtime/TestSpecsRuntime.groovy index b9380ea1..cf745a0c 100644 --- a/bigtop-tests/spec-tests/runtime/src/test/groovy/org/odpi/specs/runtime/TestSpecsRuntime.groovy +++ b/bigtop-tests/spec-tests/runtime/src/test/groovy/org/odpi/specs/runtime/TestSpecsRuntime.groovy @@ -115,8 +115,10 @@ public class TestSpecsRuntime { if ( isPathRelative ) { Assert.assertFalse("${testName} fail: ${pathString} is not relative", pathFile.isAbsolute() ) } else { - Assert.assertTrue("${testName} fail: ${pathString} does not exist", pathFile.exists() ) - Assert.assertTrue("${testName} fail: ${pathString} is not directory", pathFile.isDirectory() ) + if (!arguments['donotcheckexistance']) { + Assert.assertTrue("${testName} fail: ${pathString} does not exist", pathFile.exists() ) + Assert.assertTrue("${testName} fail: ${pathString} is not directory", pathFile.isDirectory() ) + } } break @@ -142,16 +144,14 @@ public class TestSpecsRuntime { break case 'hadoop_tools': - Assert.assertNotNull("${testName} fail: HADOOP_TOOLS environment variable should be set", ENV["HADOOP_TOOLS"]) - Assert.assertTrue("${testName} fail: HADOOP_TOOLS should be set to the HADOOP_TOOLS_PATH environment variable.", - ENV["HADOOP_TOOLS"]== ENV["HADOOP_TOOLS_PATH"]) + def toolsPathStr = getEnv("HADOOP_TOOLS_PATH", "hadoop envvars") + Assert.assertNotNull("${testName} fail: HADOOP_TOOLS_PATH environment variable should be set", toolsPathStr) - def toolsPath = new File(ENV["HADOOP_TOOLS"]) - Assert.assertTrue("${testName} fail: HADOOP_TOOLS must be an absolute path.", toolsPath.isAbsolute()) + def toolsPath = new File(toolsPathStr) + Assert.assertTrue("${testName} fail: HADOOP_TOOLS_PATH must be an absolute path.", toolsPath.isAbsolute()) - Assert.assertNotNull("HADOOP_COMMON_HOME has to be set for the test to continue", ENV["HADOOP_COMMON_HOME"]) Shell sh = new Shell() - def classPath = sh.exec("${ENV["HADOOP_COMMON_HOME"]}/bin/hadoop classpath").getOut().join("\n") + def classPath = sh.exec("hadoop classpath").getOut().join("\n") Assert.assertTrue("${testName} fail: Failed to retrieve hadoop's classpath", sh.getRet()==0) Assert.assertFalse("${testName} fail: The enire '${toolsPath}' path should not be included in the hadoop's classpath", diff --git a/bigtop-tests/spec-tests/runtime/src/test/resources/testRuntimeSpecConf.groovy b/bigtop-tests/spec-tests/runtime/src/test/resources/testRuntimeSpecConf.groovy index 98db2771..9616e7ed 100644 --- a/bigtop-tests/spec-tests/runtime/src/test/resources/testRuntimeSpecConf.groovy +++ b/bigtop-tests/spec-tests/runtime/src/test/resources/testRuntimeSpecConf.groovy @@ -15,6 +15,7 @@ specs { arguments { envcmd = 'hadoop envvars' variable = 'HADOOP_TOOLS_PATH' + donotcheckexistance = true } } 'HADOOP_EC2' { |