You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2013/09/05 05:43:41 UTC

git commit: KNOX-108: Authentication failure submitting job via WebHCAT on Sandbox

Updated Branches:
  refs/heads/master 6e52be00a -> b00493ec9


KNOX-108: Authentication failure submitting job via WebHCAT on Sandbox


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

Branch: refs/heads/master
Commit: b00493ec999bf3feecd5183040c6fe15636c27a2
Parents: 6e52be0
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Wed Sep 4 23:43:27 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Wed Sep 4 23:43:27 2013 -0400

----------------------------------------------------------------------
 build.xml                                       | 12 ++++++++++--
 gateway-release/home/conf/users.ldif            |  9 +++++++++
 gateway-release/home/samples/ExampleHdfs.groovy |  9 +++------
 .../home/samples/ExamplePutFile.groovy          |  9 +++------
 .../home/samples/ExampleSubmitJob.groovy        | 13 ++++++++-----
 .../home/samples/ExampleSubmitWorkflow.groovy   | 20 +++++++++++++-------
 .../home/samples/SampleComplexCommand.groovy    |  2 +-
 .../home/samples/SampleScript.groovy            |  7 +++----
 8 files changed, 50 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 7255c38..65415bd 100644
--- a/build.xml
+++ b/build.xml
@@ -181,7 +181,7 @@ cGkvajhUZHBNSTQ9OjpPMk5PQktYaHRyUmJoTW1zWGo0bytRPT06OkxtVjlvSDdIOWdvSEZqNTRlWVJ2
         <chmod file="install/${gateway-artifact}-${gateway-version}/conf/security/master" perm="600"/>
     </target>
 
-    <target name="start-test-ldap" description="Spawn test LDAP server.">
+    <target name="spawn-test-ldap" description="Spawn test LDAP server.">
         <exec executable="java" dir="install/${gateway-artifact}-${gateway-version}" spawn="true">
             <arg value="-jar"/>
             <arg value="bin/ldap.jar"/>
@@ -189,6 +189,14 @@ cGkvajhUZHBNSTQ9OjpPMk5PQktYaHRyUmJoTW1zWGo0bytRPT06OkxtVjlvSDdIOWdvSEZqNTRlWVJ2
         </exec>
     </target>
 
+    <target name="start-test-ldap" description="Spawn test LDAP server.">
+        <exec executable="java" dir="install/${gateway-artifact}-${gateway-version}">
+            <arg value="-jar"/>
+            <arg value="bin/ldap.jar"/>
+            <arg value="conf"/>
+        </exec>
+    </target>
+
     <target name="start-test-gateway" description="Start test gateway server.">
         <exec executable="java" dir="install/${gateway-artifact}-${gateway-version}">
             <arg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"/>
@@ -197,6 +205,6 @@ cGkvajhUZHBNSTQ9OjpPMk5PQktYaHRyUmJoTW1zWGo0bytRPT06OkxtVjlvSDdIOWdvSEZqNTRlWVJ2
         </exec>
     </target>
 
-    <target name="start-test-servers" depends="start-test-ldap,start-test-gateway" description="Spawn test LDAP server and start test gateway server."/>
+    <target name="start-test-servers" depends="spawn-test-ldap,start-test-gateway" description="Spawn test LDAP server and start test gateway server."/>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/conf/users.ldif
----------------------------------------------------------------------
diff --git a/gateway-release/home/conf/users.ldif b/gateway-release/home/conf/users.ldif
index d7aa901..8c27746 100644
--- a/gateway-release/home/conf/users.ldif
+++ b/gateway-release/home/conf/users.ldif
@@ -35,3 +35,12 @@ sn: Smith
 uid: bob
 userPassword:bob-password
 
+dn: uid=hue,ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:person
+objectclass:organizationalPerson
+objectclass:inetOrgPerson
+cn: Hue
+sn: Hue
+uid: hue
+userPassword:hue-password
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/ExampleHdfs.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/ExampleHdfs.groovy b/gateway-release/home/samples/ExampleHdfs.groovy
index 56d9f43..1f45f99 100644
--- a/gateway-release/home/samples/ExampleHdfs.groovy
+++ b/gateway-release/home/samples/ExampleHdfs.groovy
@@ -21,8 +21,8 @@ import org.apache.hadoop.gateway.shell.Hadoop
 import org.apache.hadoop.gateway.shell.hdfs.Hdfs
 
 gateway = "https://localhost:8443/gateway/sample"
-username = "bob"
-password = "bob-password"
+username = "hue"
+password = "hue-password"
 dataFile = "README"
 
 session = Hadoop.login( gateway, username, password )
@@ -34,7 +34,4 @@ println json.FileStatuses.FileStatus.pathSuffix
 text = Hdfs.get( session ).from( "/tmp/example/README" ).now().string
 println text
 Hdfs.rm( session ).file( "/tmp/example" ).recursive().now()
-session.shutdown()
-
-
-
+session.shutdown()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/ExamplePutFile.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/ExamplePutFile.groovy b/gateway-release/home/samples/ExamplePutFile.groovy
index fa3060a..1ee6087 100644
--- a/gateway-release/home/samples/ExamplePutFile.groovy
+++ b/gateway-release/home/samples/ExamplePutFile.groovy
@@ -21,8 +21,8 @@ import org.apache.hadoop.gateway.shell.Hadoop
 import org.apache.hadoop.gateway.shell.hdfs.Hdfs
 
 gateway = "https://localhost:8443/gateway/sample"
-username = "bob"
-password = "bob-password"
+username = "hue"
+password = "hue-password"
 dataFile = "README"
 
 session = Hadoop.login( gateway, username, password )
@@ -31,7 +31,4 @@ Hdfs.put( session ).file( dataFile ).to( "/tmp/example/README" ).now()
 text = Hdfs.ls( session ).dir( "/tmp/example" ).now().string
 json = (new JsonSlurper()).parseText( text )
 println json.FileStatuses.FileStatus.pathSuffix
-session.shutdown()
-
-
-
+session.shutdown()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/ExampleSubmitJob.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/ExampleSubmitJob.groovy b/gateway-release/home/samples/ExampleSubmitJob.groovy
index a60053e..6fc11d3 100644
--- a/gateway-release/home/samples/ExampleSubmitJob.groovy
+++ b/gateway-release/home/samples/ExampleSubmitJob.groovy
@@ -23,20 +23,22 @@ import org.apache.hadoop.gateway.shell.job.Job
 import static java.util.concurrent.TimeUnit.SECONDS
 
 gateway = "https://localhost:8443/gateway/sample"
-username = "bob"
-password = "bob-password"
+username = "hue"
+password = "hue-password"
 dataFile = "LICENSE"
 jarFile = "samples/hadoop-examples.jar"
 
 session = Hadoop.login( gateway, username, password )
 
-println "Delete /tmp/test " + Hdfs.rm(session).file( "/tmp/test" ).recursive().now().statusCode
-println "Create /tmp/test " + Hdfs.mkdir(session).dir( "/tmp/test").now().statusCode
+println "Delete /tmp/test " + Hdfs.rm( session ).file( "/tmp/test" ).recursive().now().statusCode
+println "Create /tmp/test " + Hdfs.mkdir( session ).dir( "/tmp/test").now().statusCode
 
 putData = Hdfs.put(session).file( dataFile ).to( "/tmp/test/input/FILE" ).later() {
   println "Put /tmp/test/input/FILE " + it.statusCode }
+
 putJar = Hdfs.put(session).file( jarFile ).to( "/tmp/test/hadoop-examples.jar" ).later() {
   println "Put /tmp/test/hadoop-examples.jar " + it.statusCode }
+
 session.waitFor( putData, putJar )
 
 jobId = Job.submitJava(session) \
@@ -57,5 +59,6 @@ while( !done && count++ < 60 ) {
 }
 println "Done " + done
 
-println "Shutdown " + session.shutdown( 10, SECONDS )
+println "Delete /tmp/test " + Hdfs.rm( session ).file( "/tmp/test" ).recursive().now().statusCode
 
+println "Shutdown " + session.shutdown( 10, SECONDS )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/ExampleSubmitWorkflow.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/ExampleSubmitWorkflow.groovy b/gateway-release/home/samples/ExampleSubmitWorkflow.groovy
index 74b641e..c3e6f2e 100644
--- a/gateway-release/home/samples/ExampleSubmitWorkflow.groovy
+++ b/gateway-release/home/samples/ExampleSubmitWorkflow.groovy
@@ -23,10 +23,10 @@ import org.apache.hadoop.gateway.shell.workflow.Workflow
 import static java.util.concurrent.TimeUnit.SECONDS
 
 gateway = "https://localhost:8443/gateway/sample"
-jobTracker = "localhost:50300";
-nameNode = "localhost:8020";
-username = "bob"
-password = "bob-password"
+jobTracker = "sandbox.hortonworks.com:8050"
+nameNode = "sandbox.hortonworks.com:8020"
+username = "hue"
+password = "hue-password"
 inputFile = "LICENSE"
 jarFile = "samples/hadoop-examples.jar"
 
@@ -66,14 +66,18 @@ configuration = """\
 
 session = Hadoop.login( gateway, username, password )
 
-println "Delete /tmp/test " + Hdfs.rm(session).file( "/tmp/test" ).recursive().now().statusCode
-println "Mkdir /tmp/test " + Hdfs.mkdir(session).dir( "/tmp/test").now().statusCode
+println "Delete /tmp/test " + Hdfs.rm( session ).file( "/tmp/test" ).recursive().now().statusCode
+println "Mkdir /tmp/test " + Hdfs.mkdir( session ).dir( "/tmp/test" ).now().statusCode
+
 putWorkflow = Hdfs.put(session).text( definition ).to( "/tmp/test/workflow.xml" ).later() {
   println "Put /tmp/test/workflow.xml " + it.statusCode }
+
 putData = Hdfs.put(session).file( inputFile ).to( "/tmp/test/input/FILE" ).later() {
   println "Put /tmp/test/input/FILE " + it.statusCode }
+
 putJar = Hdfs.put(session).file( jarFile ).to( "/tmp/test/lib/hadoop-examples.jar" ).later() {
   println "Put /tmp/test/lib/hadoop-examples.jar " + it.statusCode }
+
 session.waitFor( putWorkflow, putData, putJar )
 
 jobId = Workflow.submit(session).text( configuration ).now().jobId
@@ -89,4 +93,6 @@ while( status != "SUCCEEDED" && count++ < 60 ) {
 }
 println "Job status " + status;
 
-println "Shutdown " + session.shutdown( 10, SECONDS )
+println "Delete /tmp/test " + Hdfs.rm( session ).file( "/tmp/test" ).recursive().now().statusCode
+
+println "Shutdown " + session.shutdown( 10, SECONDS )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/SampleComplexCommand.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/SampleComplexCommand.groovy b/gateway-release/home/samples/SampleComplexCommand.groovy
index add1afb..1abfa4a 100644
--- a/gateway-release/home/samples/SampleComplexCommand.groovy
+++ b/gateway-release/home/samples/SampleComplexCommand.groovy
@@ -66,4 +66,4 @@ class SampleComplexCommand {
 
   }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b00493ec/gateway-release/home/samples/SampleScript.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/SampleScript.groovy b/gateway-release/home/samples/SampleScript.groovy
index 890f87a..379b220 100644
--- a/gateway-release/home/samples/SampleScript.groovy
+++ b/gateway-release/home/samples/SampleScript.groovy
@@ -18,12 +18,11 @@
 import org.apache.hadoop.gateway.shell.Hadoop
 
 gateway = "https://localhost:8443/gateway/sample"
-username = "bob"
-password = "bob-password"
+username = "hue"
+password = "hue-password"
 
 session = Hadoop.login( gateway, username, password )
 
 println "JSON=" + SampleService.simple(session).param("/tmp").now().string
 
-println "Names=" + SampleService.complex(session).param("/tmp").now().names
-
+println "Names=" + SampleService.complex(session).param("/tmp").now().names
\ No newline at end of file