Fixing broken unit tests.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/df4d8c2a Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/df4d8c2a Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/df4d8c2a Branch: refs/heads/nimbus-ha-branch Commit: df4d8c2adb9e7de99573ddd01b6fc81a3ff03072 Parents: 8241146 Author: Parth Brahmbhatt <[email protected]> Authored: Wed Dec 17 19:16:42 2014 -0800 Committer: Parth Brahmbhatt <[email protected]> Committed: Wed Dec 17 19:16:42 2014 -0800 ---------------------------------------------------------------------- .../test/clj/backtype/storm/nimbus_test.clj | 2 + .../backtype/storm/security/auth/auth_test.clj | 1 - .../storm/security/auth/nimbus_auth_test.clj | 41 ++++++++++---------- .../test/clj/backtype/storm/supervisor_test.clj | 1 + 4 files changed, 23 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/df4d8c2a/storm-core/test/clj/backtype/storm/nimbus_test.clj ---------------------------------------------------------------------- diff --git a/storm-core/test/clj/backtype/storm/nimbus_test.clj b/storm-core/test/clj/backtype/storm/nimbus_test.clj index 151f3c7..b94cb36 100644 --- a/storm-core/test/clj/backtype/storm/nimbus_test.clj +++ b/storm-core/test/clj/backtype/storm/nimbus_test.clj @@ -1244,6 +1244,8 @@ uptime-computer nil new-instance nil mk-timer nil + nimbus/mk-bt-tracker nil + nimbus/mk-leader-elector nil nimbus/mk-scheduler nil] (nimbus/nimbus-data auth-conf fake-inimbus) (verify-call-times-for cluster/mk-storm-cluster-state 1) http://git-wip-us.apache.org/repos/asf/storm/blob/df4d8c2a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj ---------------------------------------------------------------------- diff --git a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj index 0e697d9..4c5e32c 100644 --- a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj +++ b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj @@ -123,7 +123,6 @@ (defn launch-server [server-port login-cfg aznClass transportPluginClass serverConf] (let [conf1 (merge (read-storm-config) {NIMBUS-AUTHORIZER aznClass - NIMBUS-HOST "localhost" NIMBUS-THRIFT-PORT server-port STORM-THRIFT-TRANSPORT-PLUGIN transportPluginClass}) conf2 (if login-cfg (merge conf1 {"java.security.auth.login.config" login-cfg}) conf1) http://git-wip-us.apache.org/repos/asf/storm/blob/df4d8c2a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj ---------------------------------------------------------------------- diff --git a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj index bb70239..a776693 100644 --- a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj +++ b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj @@ -48,6 +48,7 @@ nimbus-server (ThriftServer. (:daemon-conf cluster-map) (Nimbus$Processor. (:nimbus cluster-map)) ThriftConnectionType/NIMBUS)] + (Thread/sleep 2000) (.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop nimbus-server)))) (.start (Thread. #(.serve nimbus-server))) (wait-for-condition #(.isServing nimbus-server)) @@ -60,7 +61,7 @@ (testing/kill-local-storm-cluster cluster-map#) (.stop nimbus-server#))) -(deftest Simple-authentication-test +(deftest Simple-authentication-test (with-test-cluster [6627 nil nil "backtype.storm.security.auth.SimpleTransportPlugin"] (let [storm-conf (merge (read-storm-config) {STORM-THRIFT-TRANSPORT-PLUGIN "backtype.storm.security.auth.SimpleTransportPlugin" @@ -71,10 +72,10 @@ (is (thrown-cause? NotAliveException (.activate nimbus_client "topo-name")))) (.close client)))) - -(deftest test-noop-authorization-w-simple-transport - (with-test-cluster [6628 nil - "backtype.storm.security.auth.authorizer.NoopAuthorizer" + +(deftest test-noop-authorization-w-simple-transport + (with-test-cluster [6628 nil + "backtype.storm.security.auth.authorizer.NoopAuthorizer" "backtype.storm.security.auth.SimpleTransportPlugin"] (let [storm-conf (merge (read-storm-config) {STORM-THRIFT-TRANSPORT-PLUGIN "backtype.storm.security.auth.SimpleTransportPlugin" @@ -86,22 +87,22 @@ (.activate nimbus_client "topo-name")))) (.close client)))) -(deftest test-deny-authorization-w-simple-transport +(deftest test-deny-authorization-w-simple-transport (with-test-cluster [6629 nil - "backtype.storm.security.auth.authorizer.DenyAuthorizer" + "backtype.storm.security.auth.authorizer.DenyAuthorizer" "backtype.storm.security.auth.SimpleTransportPlugin"] (let [storm-conf (merge (read-storm-config) {STORM-THRIFT-TRANSPORT-PLUGIN "backtype.storm.security.auth.SimpleTransportPlugin" - Config/NIMBUS_HOST "localhost" Config/NIMBUS_THRIFT_PORT 6629 STORM-NIMBUS-RETRY-TIMES 0}) - client (NimbusClient/getConfiguredClient storm-conf) + client (NimbusClient. storm-conf "localhost" 6629 nimbus-timeout) nimbus_client (.getClient client) topologyInitialStatus (TopologyInitialStatus/findByValue 2) submitOptions (SubmitOptions. topologyInitialStatus)] - (is (thrown-cause? AuthorizationException (.submitTopology nimbus_client "topo-name" nil nil nil))) + (is (thrown-cause? AuthorizationException (.submitTopology nimbus_client "topo-name" nil nil nil))) (is (thrown-cause? AuthorizationException (.submitTopologyWithOpts nimbus_client "topo-name" nil nil nil submitOptions))) (is (thrown-cause? AuthorizationException (.beginFileUpload nimbus_client))) + (is (thrown-cause? AuthorizationException (.uploadChunk nimbus_client nil nil))) (is (thrown-cause? AuthorizationException (.finishFileUpload nimbus_client nil))) (is (thrown-cause? AuthorizationException (.beginFileDownload nimbus_client nil))) @@ -123,40 +124,38 @@ (is (thrown-cause? AuthorizationException (.getTopologyInfo nimbus_client "topo-ID")))) (.close client)))) -(deftest test-noop-authorization-w-sasl-digest +(deftest test-noop-authorization-w-sasl-digest (with-test-cluster [6630 - "test/clj/backtype/storm/security/auth/jaas_digest.conf" - "backtype.storm.security.auth.authorizer.NoopAuthorizer" + "test/clj/backtype/storm/security/auth/jaas_digest.conf" + "backtype.storm.security.auth.authorizer.NoopAuthorizer" "backtype.storm.security.auth.digest.DigestSaslTransportPlugin"] (let [storm-conf (merge (read-storm-config) {STORM-THRIFT-TRANSPORT-PLUGIN "backtype.storm.security.auth.digest.DigestSaslTransportPlugin" "java.security.auth.login.config" "test/clj/backtype/storm/security/auth/jaas_digest.conf" - Config/NIMBUS_HOST "localhost" Config/NIMBUS_THRIFT_PORT 6630 STORM-NIMBUS-RETRY-TIMES 0}) - client (NimbusClient/getConfiguredClient storm-conf) + client (NimbusClient. storm-conf "localhost" 6630 nimbus-timeout) nimbus_client (.getClient client)] (testing "(Positive authorization) Authorization plugin should accept client request" (is (thrown-cause? NotAliveException (.activate nimbus_client "topo-name")))) (.close client)))) -(deftest test-deny-authorization-w-sasl-digest +(deftest test-deny-authorization-w-sasl-digest (with-test-cluster [6631 - "test/clj/backtype/storm/security/auth/jaas_digest.conf" - "backtype.storm.security.auth.authorizer.DenyAuthorizer" + "test/clj/backtype/storm/security/auth/jaas_digest.conf" + "backtype.storm.security.auth.authorizer.DenyAuthorizer" "backtype.storm.security.auth.digest.DigestSaslTransportPlugin"] (let [storm-conf (merge (read-storm-config) {STORM-THRIFT-TRANSPORT-PLUGIN "backtype.storm.security.auth.digest.DigestSaslTransportPlugin" "java.security.auth.login.config" "test/clj/backtype/storm/security/auth/jaas_digest.conf" - Config/NIMBUS_HOST "localhost" Config/NIMBUS_THRIFT_PORT 6631 STORM-NIMBUS-RETRY-TIMES 0}) - client (NimbusClient/getConfiguredClient storm-conf) + client (NimbusClient. storm-conf "localhost" 6631 nimbus-timeout) nimbus_client (.getClient client) topologyInitialStatus (TopologyInitialStatus/findByValue 2) submitOptions (SubmitOptions. topologyInitialStatus)] - (is (thrown-cause? AuthorizationException (.submitTopology nimbus_client "topo-name" nil nil nil))) + (is (thrown-cause? AuthorizationException (.submitTopology nimbus_client "topo-name" nil nil nil))) (is (thrown-cause? AuthorizationException (.submitTopologyWithOpts nimbus_client "topo-name" nil nil nil submitOptions))) (is (thrown-cause? AuthorizationException (.beginFileUpload nimbus_client))) (is (thrown-cause? AuthorizationException (.uploadChunk nimbus_client nil nil))) http://git-wip-us.apache.org/repos/asf/storm/blob/df4d8c2a/storm-core/test/clj/backtype/storm/supervisor_test.clj ---------------------------------------------------------------------- diff --git a/storm-core/test/clj/backtype/storm/supervisor_test.clj b/storm-core/test/clj/backtype/storm/supervisor_test.clj index a3594a3..dfe45cc 100644 --- a/storm-core/test/clj/backtype/storm/supervisor_test.clj +++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj @@ -481,6 +481,7 @@ cluster/mk-storm-cluster-state nil supervisor-state nil local-hostname nil + supervisor/mk-bt-tracker nil mk-timer nil] (supervisor/supervisor-data auth-conf nil fake-isupervisor) (verify-call-times-for cluster/mk-storm-cluster-state 1)
