Repository: incubator-slider
Updated Branches:
  refs/heads/develop 3b2f5f6bb -> 1bbeebedb


SLIDER-141. Functional test fails with [Permission denied] on cluster


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/716cdeb3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/716cdeb3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/716cdeb3

Branch: refs/heads/develop
Commit: 716cdeb3b7508de81b9e53ab7c45d0055e1386bd
Parents: 3b2f5f6
Author: Sumit Mohanty <smoha...@hortonworks.com>
Authored: Tue Jun 17 17:46:29 2014 -0700
Committer: Sumit Mohanty <smoha...@hortonworks.com>
Committed: Tue Jun 17 17:46:29 2014 -0700

----------------------------------------------------------------------
 .../test_command_log/appConfig.json             |  4 +--
 .../lifecycle/AgentCommandTestBase.groovy       | 35 ++++++++++++--------
 .../lifecycle/TestClusterBuildDestroy.groovy    |  3 ++
 3 files changed, 27 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/716cdeb3/slider-core/src/test/app_packages/test_command_log/appConfig.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig.json 
b/slider-core/src/test/app_packages/test_command_log/appConfig.json
index 0bace19..bd76c05 100644
--- a/slider-core/src/test/app_packages/test_command_log/appConfig.json
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig.json
@@ -3,8 +3,8 @@
     "metadata": {
     },
     "global": {
-        "agent.conf": "/slider/agent/conf/agent.ini",
-        "application.def": "/slider/cmd_log_app_pkg.zip",
+        "agent.conf": "agent.ini",
+        "application.def": "cmd_log_app_pkg.zip",
         "config_types": "cl-site",
         "java_home": "/usr/jdk64/jdk1.7.0_45",
         "package_list": "files/command_log_10.tar",

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/716cdeb3/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git 
a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
 
b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
index d1d6f07..56cc4be 100644
--- 
a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
+++ 
b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
@@ -29,11 +29,14 @@ import org.apache.slider.funtest.framework.SliderShell
 import org.apache.tools.zip.ZipEntry
 import org.apache.tools.zip.ZipOutputStream
 import org.junit.Assert
+import org.junit.Assume
 import org.junit.Before
 import org.junit.BeforeClass
 import org.junit.rules.TemporaryFolder
 import org.junit.Rule
 
+import org.apache.hadoop.security.AccessControlException
+
 
 @Slf4j
 class AgentCommandTestBase extends CommandTestBase
@@ -67,23 +70,29 @@ class AgentCommandTestBase extends CommandTestBase
   public static void setupAgent() {
     assumeAgentTestsEnabled()
 
-    // Upload the agent tarball
-    assume(LOCAL_SLIDER_AGENT_TARGZ.exists(), "Slider agent not found at 
$LOCAL_SLIDER_AGENT_TARGZ")
-    agentTarballPath = new Path(clusterFS.homeDirectory, 
"/slider/agent/slider-agent.tar.gz")
-    Path localTarball = new Path(LOCAL_SLIDER_AGENT_TARGZ.toURI());
-    clusterFS.copyFromLocalFile(false, true, localTarball, agentTarballPath)
-
-    // Upload the agent.ini
-    assume(LOCAL_AGENT_CONF.exists(), "Agent config not found at 
$LOCAL_AGENT_CONF")
-    agtIniPath = new Path(clusterFS.homeDirectory, 
"/slider/agent/conf/agent.ini")
-    Path localAgtIni = new Path(LOCAL_AGENT_CONF.toURI());
-    clusterFS.copyFromLocalFile(false, true, localAgtIni, agtIniPath)
+    try {
+      // Upload the agent tarball
+      assume(LOCAL_SLIDER_AGENT_TARGZ.exists(), "Slider agent not found at 
$LOCAL_SLIDER_AGENT_TARGZ")
+      agentTarballPath = new Path(clusterFS.homeDirectory, 
"slider-agent.tar.gz")
+      Path localTarball = new Path(LOCAL_SLIDER_AGENT_TARGZ.toURI());
+      clusterFS.copyFromLocalFile(false, true, localTarball, agentTarballPath)
+
+      // Upload the agent.ini
+      assume(LOCAL_AGENT_CONF.exists(), "Agent config not found at 
$LOCAL_AGENT_CONF")
+      agtIniPath = new Path(clusterFS.homeDirectory, "agent.ini")
+      Path localAgtIni = new Path(LOCAL_AGENT_CONF.toURI());
+      clusterFS.copyFromLocalFile(false, true, localAgtIni, agtIniPath)
+    } catch (AccessControlException ace) {
+      log.info "No write access to test user home directory. " +
+               "Ensure home directory exists and has correct permissions." + 
ace.getMessage()
+      Assume.assumeTrue("Ensure home directory exists and has correct 
permissions for test user.", false)
+    }
   }
 
 
   @Before
-  public void specificSetupForTest() {
-    appPkgPath = new Path(clusterFS.homeDirectory, 
"/slider/cmd_log_app_pkg.zip")
+  public void setupApplicationPackage() {
+    appPkgPath = new Path(clusterFS.homeDirectory, "cmd_log_app_pkg.zip")
     if (!clusterFS.exists(appPkgPath)) {
       clusterFS.delete(appPkgPath, false)
     }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/716cdeb3/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
----------------------------------------------------------------------
diff --git 
a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
 
b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
index 0c3924f..3db6c5b 100644
--- 
a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
+++ 
b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
@@ -60,8 +60,11 @@ public class TestClusterBuildDestroy extends 
AgentCommandTestBase
         [
             ACTION_BUILD,
             CLUSTER,
+            ARG_IMAGE, agentTarballPath.toString(),
             ARG_ZKHOSTS,
             SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, 
DEFAULT_SLIDER_ZK_HOSTS),
+            ARG_TEMPLATE, APP_TEMPLATE,
+            ARG_RESOURCES, APP_RESOURCE
         ])
 
 

Reply via email to