kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-3728; EndToEndAuthorizationTest offsets_topic misconfigured
Date Fri, 03 Jun 2016 20:49:15 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.0 c0537b5f0 -> 717c7bbc3


KAFKA-3728; EndToEndAuthorizationTest offsets_topic misconfigured

Set OffsetsTopicReplicationFactorProp to 3 like MinInSyncReplicasProp  Else a consumer was
able to consume via assign but not via subscribe, so the testProduceAndConsume is now duplicated
to check both paths

Author: Edoardo Comar <ecomar@uk.ibm.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #1425 from edoardocomar/KAFKA-3728

(cherry picked from commit 49ddc897b8feda9c4786d5bcd03814b91ede7124)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/717c7bbc
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/717c7bbc
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/717c7bbc

Branch: refs/heads/0.10.0
Commit: 717c7bbc39b56a17a413b3bd02c776d9b79e9b3e
Parents: c0537b5
Author: Edoardo Comar <ecomar@uk.ibm.com>
Authored: Fri Jun 3 21:31:27 2016 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri Jun 3 21:31:41 2016 +0100

----------------------------------------------------------------------
 .../kafka/api/EndToEndAuthorizationTest.scala   | 22 +++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/717c7bbc/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
index e13f160..05d8dc5 100644
--- a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
@@ -132,7 +132,7 @@ trait EndToEndAuthorizationTest extends IntegrationTestHarness with SaslSetup
{
   this.serverConfig.setProperty(KafkaConfig.AuthorizerClassNameProp, classOf[SimpleAclAuthorizer].getName)
   // Some needed configuration for brokers, producers, and consumers
   this.serverConfig.setProperty(KafkaConfig.OffsetsTopicPartitionsProp, "1")
-  this.serverConfig.setProperty(KafkaConfig.OffsetsTopicReplicationFactorProp, "1")
+  this.serverConfig.setProperty(KafkaConfig.OffsetsTopicReplicationFactorProp, "3")
   this.serverConfig.setProperty(KafkaConfig.MinInSyncReplicasProp, "3")
   this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "group")
 
@@ -169,7 +169,22 @@ trait EndToEndAuthorizationTest extends IntegrationTestHarness with SaslSetup
{
     * Tests the ability of producing and consuming with the appropriate ACLs set.
     */
   @Test
-  def testProduceConsume {
+  def testProduceConsumeViaAssign {
+    setAclsAndProduce()
+    consumers.head.assign(List(tp).asJava)
+    consumeRecords(this.consumers.head, numRecords)
+    debug("Finished consuming")
+  }
+
+  @Test
+  def testProduceConsumeViaSubscribe {
+    setAclsAndProduce()
+    consumers.head.subscribe(List(topic).asJava)
+    consumeRecords(this.consumers.head, numRecords)
+    debug("Finished consuming")
+  }
+
+  private def setAclsAndProduce() {
     AclCommand.main(produceAclArgs)
     AclCommand.main(consumeAclArgs)
     servers.foreach(s => {
@@ -181,9 +196,6 @@ trait EndToEndAuthorizationTest extends IntegrationTestHarness with SaslSetup
{
     sendRecords(numRecords, tp)
     //Consume records
     debug("Finished sending and starting to consume records")
-    consumers.head.assign(List(tp).asJava)
-    consumeRecords(this.consumers.head, numRecords)
-    debug("Finished consuming")
   }
 
   /**


Mime
View raw message