def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Create directories with the correct permissions for test with userid and external volumes.
        cls.machine.ssh("mkdir -p /tmp/kafka-config-kitchen-sink-test/data")
        cls.machine.ssh(
            "sudo chown -R 12345 /tmp/kafka-config-kitchen-sink-test/data")

        # Copy SSL files.
        cls.machine.ssh("mkdir -p /tmp/kafka-config-test/secrets")
        local_secrets_dir = os.path.join(FIXTURES_DIR, "secrets")
        cls.machine.scp_to_machine(local_secrets_dir, "/tmp/kafka-config-test")

        cls.cluster = utils.TestCluster("config-test", FIXTURES_DIR,
                                        "standalone-config.yml")
        cls.cluster.start()

        # Create keytabs
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="broker1",
                                        principal="kafka",
                                        hostname="sasl-ssl-config"))

        assert "PASS" in cls.cluster.run_command_on_service(
            "zookeeper", ZK_READY.format(servers="localhost:2181"))
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        cls.machine.ssh("mkdir -p /tmp/kafka-connect-single-node-test/jars")
        local_jars_dir = os.path.join(FIXTURES_DIR, "jars")
        cls.machine.scp_to_machine(local_jars_dir,
                                   "/tmp/kafka-connect-single-node-test")

        cls.machine.ssh("mkdir -p /tmp/kafka-connect-single-node-test/sql")
        local_sql_dir = os.path.join(FIXTURES_DIR, "sql")
        cls.machine.scp_to_machine(local_sql_dir,
                                   "/tmp/kafka-connect-single-node-test")

        cls.machine.ssh("mkdir -p /tmp/kafka-connect-single-node-test/scripts")
        local_scripts_dir = os.path.join(FIXTURES_DIR, "scripts")
        cls.machine.scp_to_machine(local_scripts_dir,
                                   "/tmp/kafka-connect-single-node-test")

        cls.cluster = utils.TestCluster("distributed-single-node",
                                        FIXTURES_DIR,
                                        "distributed-single-node.yml")
        cls.cluster.start()
        # assert "PASS" in cls.cluster.run_command_on_service("zookeeper-bridge", ZK_READY.format(servers="localhost:2181"))
        assert "PASS" in cls.cluster.run_command_on_service(
            "zookeeper-host", ZK_READY.format(servers="localhost:32181"))
        # assert "PASS" in cls.cluster.run_command_on_service("kafka-bridge", KAFKA_READY.format(brokers=1))
        assert "PASS" in cls.cluster.run_command_on_service(
            "kafka-host", KAFKA_READY.format(brokers=1))
        assert "PASS" in cls.cluster.run_command_on_service(
            "schema-registry-host",
            SR_READY.format(host="localhost", port="8081"))
Esempio n. 3
0
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Add a hostname mapped to eth0, required for SASL to work predictably.
        # localhost and hostname both resolve to 127.0.0.1 in the docker image, so using localhost causes unprodicatable behaviour
        #  with zkclient
        cmd = """
            "sudo sh -c 'grep sasl.kafka.com /etc/hosts || echo {IP} sasl.kafka.com >> /etc/hosts'"
        """.strip()
        cls.machine.ssh(cmd.format(IP=cls.machine.get_internal_ip().strip()))

        # Copy SSL files.
        cls.machine.ssh("mkdir -p /tmp/kafka-cluster-host-test/secrets")

        local_secrets_dir = os.path.join(FIXTURES_DIR, "secrets")
        cls.machine.scp_to_machine(local_secrets_dir, "/tmp/kafka-cluster-host-test")

        cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR, "cluster-host-sasl.yml")
        cls.cluster.start()

        # Create keytabs
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="host_broker1", principal="kafka", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="host_broker2", principal="kafka", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="host_broker3", principal="kafka", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="host_producer", principal="host_producer", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="host_consumer", principal="host_consumer", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zookeeper-host-1", principal="zookeeper", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zookeeper-host-2", principal="zookeeper", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zookeeper-host-3", principal="zookeeper", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zkclient-host-1", principal="zkclient", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zkclient-host-2", principal="zkclient", hostname="sasl.kafka.com"))
        cls.cluster.run_command_on_service("kerberos", KADMIN_KEYTAB_CREATE.format(filename="zkclient-host-3", principal="zkclient", hostname="sasl.kafka.com"))

        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-sasl-1", ZK_READY.format(servers="sasl.kafka.com:22181,sasl.kafka.com:32181,sasl.kafka.com:42181"))
 def setUpClass(cls):
     cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR,
                                     "cluster-host-plain.yml")
     cls.cluster.start()
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-1",
         ZK_READY.format(
             servers="localhost:22181,localhost:32181,localhost:42181"))
 def setUpClass(cls):
     cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR,
                                     "cluster-bridged-plain.yml")
     cls.cluster.start()
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-1",
         ZK_READY.format(
             servers="zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"))
 def setUpClass(cls):
     cls.cluster = utils.TestCluster("standalone-network-test",
                                     FIXTURES_DIR, "standalone-network.yml")
     cls.cluster.start()
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-bridge", ZK_READY.format(servers="localhost:2181"))
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-host", ZK_READY.format(servers="localhost:32181"))
    def setUpClass(cls):

        cls.cluster = utils.TestCluster("config-test", FIXTURES_DIR, "distributed-config.yml")
        cls.cluster.start()

        assert "PASS" in cls.cluster.run_command_on_service("zookeeper", ZK_READY.format(servers="localhost:2181"))
        assert "PASS" in cls.cluster.run_command_on_service("kafka", KAFKA_READY.format(brokers=1))
        assert "PASS" in cls.cluster.run_command_on_service("schema-registry", SR_READY.format(host="schema-registry", port="8081"))
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        cls.cluster = utils.TestCluster("config-test", FIXTURES_DIR,
                                        "standalone-config.yml")
        cls.cluster.start()

        assert "PASS" in cls.cluster.run_command_on_service(
            "zookeeper", ZK_READY.format(servers="localhost:2181"))
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        cls.machine.ssh("mkdir -p /tmp/kafka-connect-host-cluster-test/jars")
        local_jars_dir = os.path.join(FIXTURES_DIR, "jars")
        cls.machine.scp_to_machine(local_jars_dir, "/tmp/kafka-connect-host-cluster-test")
        cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR, "cluster-host-plain.yml")
        cls.cluster.start()
        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-1", ZK_READY.format(servers="localhost:22181,localhost:32181,localhost:42181"))
        assert "PASS" in cls.cluster.run_command_on_service("kafka-1", KAFKA_READY.format(brokers=3))
Esempio n. 10
0
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        print cls.machine.ssh("mkdir -p /tmp/kafka-cluster-bridge-test/secrets")
        local_secrets_dir = os.path.join(FIXTURES_DIR, "secrets")
        cls.machine.scp_to_machine(local_secrets_dir, "/tmp/kafka-cluster-bridge-test")

        cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR, "cluster-bridged-ssl.yml")
        cls.cluster.start()
        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-1", ZK_READY.format(servers="zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"))
Esempio n. 11
0
 def setUpClass(cls):
     machine_name = os.environ["DOCKER_MACHINE_NAME"]
     cls.machine = utils.TestMachine(machine_name)
     cls.cluster = utils.TestCluster("config-test", FIXTURES_DIR,
                                     "standalone-config.yml")
     cls.cluster.start()
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper", ZK_READY.format(servers="localhost:2181"))
     assert "PASS" in cls.cluster.run_command_on_service(
         "kafka", KAFKA_READY.format(num_brokers=1))
     assert "PASS" in cls.cluster.run_command_on_service(
         "schema-registry",
         SR_READY.format(host="schema-registry", port=8081))
Esempio n. 12
0
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        print cls.machine.ssh(
            "mkdir -p /tmp/kafka-cluster-bridge-test/secrets")
        local_secrets_dir = os.path.join(FIXTURES_DIR, "secrets")
        cls.machine.scp_to_machine(local_secrets_dir,
                                   "/tmp/kafka-cluster-bridge-test")

        cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR,
                                        "cluster-bridged-sasl.yml")
        cls.cluster.start()

        # Create keytabs
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_broker1",
                                        principal="kafka",
                                        hostname="kafka-sasl-ssl-1"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_broker2",
                                        principal="kafka",
                                        hostname="kafka-sasl-ssl-2"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_broker3",
                                        principal="kafka",
                                        hostname="kafka-sasl-ssl-3"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_kafkacat",
                                        principal="bridged_kafkacat",
                                        hostname="bridged-kafkacat"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_producer",
                                        principal="bridged_producer",
                                        hostname="kafka-sasl-ssl-producer"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="bridged_consumer",
                                        principal="bridged_consumer",
                                        hostname="kafka-sasl-ssl-consumer"))

        assert "PASS" in cls.cluster.run_command_on_service(
            "zookeeper-1",
            ZK_READY.format(
                servers="zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"))
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        cls.base_dir = "/tmp/replicator-host-cluster-test"
        cls.cluster = utils.TestCluster("replicator-test", FIXTURES_DIR, "cluster-host-plain.yml")
        cls.cluster.start()
        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-src-a", ZK_READY.format(servers="localhost:22181"))
        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-src-b", ZK_READY.format(servers="localhost:32181"))
        assert "PASS" in cls.cluster.run_command_on_service("zookeeper-dest", ZK_READY.format(servers="localhost:42181"))
        assert "PASS" in cls.cluster.run_command_on_service("kafka-1-src-a", KAFKA_READY.format(brokers=2))
        assert "PASS" in cls.cluster.run_command_on_service("kafka-1-src-a", KAFKA_READY.format(brokers=2))
        assert "PASS" in cls.cluster.run_command_on_service("kafka-1-dest", KAFKA_READY.format(brokers=2))
Esempio n. 14
0
    def setUpClass(cls):
        machine_name = os.environ["DOCKER_MACHINE_NAME"]
        cls.machine = utils.TestMachine(machine_name)

        # Copy SSL files.
        cls.machine.ssh("mkdir -p /tmp/zookeeper-bridged-test/secrets")
        local_secrets_dir = os.path.join(FIXTURES_DIR, "secrets")
        cls.machine.scp_to_machine(local_secrets_dir,
                                   "/tmp/zookeeper-bridged-test")

        cls.cluster = utils.TestCluster("cluster-test", FIXTURES_DIR,
                                        "cluster-bridged.yml")
        cls.cluster.start()

        # Create keytabs
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zookeeper-bridged-1",
                                        principal="zookeeper",
                                        hostname="zookeeper-sasl-1"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zookeeper-bridged-2",
                                        principal="zookeeper",
                                        hostname="zookeeper-sasl-2"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zookeeper-bridged-3",
                                        principal="zookeeper",
                                        hostname="zookeeper-sasl-3"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zkclient-bridged-1",
                                        principal="zkclient",
                                        hostname="zookeeper-sasl-1"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zkclient-bridged-2",
                                        principal="zkclient",
                                        hostname="zookeeper-sasl-2"))
        cls.cluster.run_command_on_service(
            "kerberos",
            KADMIN_KEYTAB_CREATE.format(filename="zkclient-bridged-3",
                                        principal="zkclient",
                                        hostname="zookeeper-sasl-3"))
Esempio n. 15
0
 def setUpClass(cls):
     cls.cluster = utils.TestCluster("standalone-network-test",
                                     FIXTURES_DIR, "standalone-network.yml")
     cls.cluster.start()
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-bridge", ZK_READY.format(servers="localhost:12181"))
     assert "PASS" in cls.cluster.run_command_on_service(
         "kafka-bridge", KAFKA_READY.format(num_brokers=1))
     assert "PASS" in cls.cluster.run_command_on_service(
         "schema-registry-bridge",
         SR_READY.format(host="schema-registry-bridge", port=18081))
     assert "PASS" in cls.cluster.run_command_on_service(
         "zookeeper-host", ZK_READY.format(servers="localhost:32181"))
     assert "PASS" in cls.cluster.run_command_on_service(
         "kafka-host", KAFKA_READY.format(num_brokers=1))
     assert "PASS" in cls.cluster.run_command_on_service(
         "schema-registry-host",
         SR_READY.format(host="localhost", port=38081))
Esempio n. 16
0
 def setUpClass(cls):
     cls.cluster = utils.TestCluster("standalone-network-test",
                                     FIXTURES_DIR, "standalone-network.yml")
     cls.cluster.start()