Repository: incubator-slider
Updated Branches:
  refs/heads/develop 3b3886d4f -> 7559f3f2e


SLIDER-500, tests for changed naming logic. These will fail until hadoop has 
the relevant patch


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

Branch: refs/heads/develop
Commit: df7bb9af1b2b3b1e279ad099d710d8c318dcc6d6
Parents: 3b3886d
Author: Steve Loughran <ste...@apache.org>
Authored: Fri Oct 10 15:06:09 2014 -0700
Committer: Steve Loughran <ste...@apache.org>
Committed: Fri Oct 10 15:06:09 2014 -0700

----------------------------------------------------------------------
 .../TestStandaloneYarnRegistryAM.groovy         | 13 ++++++
 .../slider/registry/TestRegistryPaths.groovy    | 45 ++++++++++++++++++++
 2 files changed, 58 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/df7bb9af/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
index 700a6d8..d2c8ce0 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
@@ -68,6 +68,7 @@ class TestStandaloneYarnRegistryAM extends 
AgentMiniClusterTestBase {
 
 
   public static final String ARTIFACT_NAME = PublishedArtifacts.COMPLETE_CONFIG
+  public static final String HBASE = "hbase/localh...@hadoop.apache.org"
 
   @Test
   public void testStandaloneYarnRegistryAM() throws Throwable {
@@ -485,6 +486,18 @@ class TestStandaloneYarnRegistryAM extends 
AgentMiniClusterTestBase {
     assert oldInstance != null
     assert oldInstance.yarnApplicationState >= YarnApplicationState.FINISHED
 
+    
+    // verify hbase to path generation filters things
+    def hbase = homePathForUser(HBASE)
+    def hbaseServices = serviceclassPath(hbase, SliderKeys.APP_TYPE)
+
+    
+    assert SliderExitCodes.EXIT_NOT_FOUND == client.actionResolve(
+        new ActionResolveArgs(
+            path: hbaseServices,
+            list: true))
+    assert SliderExitCodes.EXIT_NOT_FOUND == client.actionResolve(
+        new ActionResolveArgs(path: hbaseServices))
 
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/df7bb9af/slider-core/src/test/groovy/org/apache/slider/registry/TestRegistryPaths.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/registry/TestRegistryPaths.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/registry/TestRegistryPaths.groovy
new file mode 100644
index 0000000..795a084
--- /dev/null
+++ 
b/slider-core/src/test/groovy/org/apache/slider/registry/TestRegistryPaths.groovy
@@ -0,0 +1,45 @@
+/*
+ * 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.slider.registry
+
+import org.apache.hadoop.registry.client.binding.RegistryUtils
+import org.junit.Test
+
+class TestRegistryPaths {
+
+  @Test
+  public void testHomedirKerberos() throws Throwable {
+    def home = RegistryUtils.homePathForUser("hb...@hadoop.apache.org")
+    assert !home.contains("@")
+    assert !home.contains(".")
+    assert !home.contains(".APACHE")
+    assert home == "/users/hbase"
+  }
+    
+  @Test
+  public void testHomedirKerberosHost() throws Throwable {
+    def home = 
RegistryUtils.homePathForUser("hbase/localh...@hadoop.apache.org")
+    assert home == "/users/hbase"
+    assert !home.contains("@")
+    assert !home.contains(".")
+    assert !home.contains(".APACHE")
+  }
+  
+  
+}

Reply via email to