diff options
| author | Dana Powers <dana.powers@gmail.com> | 2016-04-04 19:54:22 -0700 | 
|---|---|---|
| committer | Dana Powers <dana.powers@gmail.com> | 2016-04-09 09:24:40 -0700 | 
| commit | 097198cceaed97d5b804166d0c76a816c8dfead0 (patch) | |
| tree | 54c8520e94af2d72ca715c4db9bb855fbfa5574d /test | |
| parent | 01f03656cc613a2281d22521da4a016c7fa4a8ba (diff) | |
| download | kafka-python-097198cceaed97d5b804166d0c76a816c8dfead0.tar.gz | |
Attempt to add ssl support to kafka fixturesssl_support
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixtures.py | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/test/fixtures.py b/test/fixtures.py index e25ac22..826d037 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -182,8 +182,8 @@ class ZookeeperFixture(Fixture):  class KafkaFixture(Fixture):      @classmethod -    def instance(cls, broker_id, zk_host, zk_port, -                 zk_chroot=None, port=None, replicas=1, partitions=2): +    def instance(cls, broker_id, zk_host, zk_port, zk_chroot=None, port=None, +                 transport='PLAINTEXT', replicas=1, partitions=2):          if zk_chroot is None:              zk_chroot = "kafka-python_" + str(uuid.uuid4()).replace("-", "_")          if "KAFKA_URI" in os.environ: @@ -194,16 +194,21 @@ class KafkaFixture(Fixture):              if port is None:                  port = get_open_port()              host = "127.0.0.1" -            fixture = KafkaFixture(host, port, broker_id, zk_host, zk_port, zk_chroot, +            fixture = KafkaFixture(host, port, broker_id, +                                   zk_host, zk_port, zk_chroot, +                                   transport=transport,                                     replicas=replicas, partitions=partitions)              fixture.open()          return fixture -    def __init__(self, host, port, broker_id, zk_host, zk_port, zk_chroot, replicas=1, partitions=2): +    def __init__(self, host, port, broker_id, zk_host, zk_port, zk_chroot, +                 replicas=1, partitions=2, transport='PLAINTEXT'):          self.host = host          self.port = port          self.broker_id = broker_id +        self.transport = transport.upper() +        self.ssl_dir = self.test_resource('ssl')          self.zk_host = zk_host          self.zk_port = zk_port @@ -233,6 +238,7 @@ class KafkaFixture(Fixture):          self.out("Running local instance...")          log.info("  host       = %s", self.host)          log.info("  port       = %s", self.port) +        log.info("  transport  = %s", self.transport)          log.info("  broker_id  = %s", self.broker_id)          log.info("  zk_host    = %s", self.zk_host)          log.info("  zk_port    = %s", self.zk_port)  | 
