From f3fab2e476cf5101ba6ae68e4d61ae9ab957b26c Mon Sep 17 00:00:00 2001 From: "Colin P. Mccabe" Date: Tue, 28 Feb 2017 12:21:46 -0800 Subject: [PATCH] KAFKA-4809: docker/run_tests.sh should set up /opt/kafka-dev to be the source directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …0.x and not 0.8 Author: Colin P. Mccabe Reviewers: Ewen Cheslack-Postava Closes #2602 from cmccabe/KAFKA-4809 --- tests/docker/Dockerfile | 20 +++++++------------ tests/docker/run_tests.sh | 14 ++----------- .../sanity_checks/test_verifiable_producer.py | 4 +++- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/tests/docker/Dockerfile b/tests/docker/Dockerfile index 82e2e55f4..3a3df3242 100644 --- a/tests/docker/Dockerfile +++ b/tests/docker/Dockerfile @@ -16,22 +16,16 @@ FROM openjdk:8 MAINTAINER Apache Kafka dev@kafka.apache.org -RUN apt update -RUN apt install -y unzip wget curl jq coreutils openssh-server net-tools vim openjdk-8-jdk python-pip python-dev libffi-dev libssl-dev -RUN pip install -U pip -RUN pip install --upgrade cffi -RUN pip install ducktape==0.6.0 - -VOLUME ["/kafka_src"] - +VOLUME ["/opt/kafka-dev"] ENV MIRROR="http://apache.cs.utah.edu/" -RUN wget -q "${MIRROR}kafka/0.8.2.2/kafka_2.10-0.8.2.2.tgz" -O "/tmp/kafka_2.10-0.8.2.2.tgz" && tar xfz /tmp/kafka_2.10-0.8.2.2.tgz -C /opt && mv "/opt/kafka_2.10-0.8.2.2" "/opt/kafka-0.8.2.2" -RUN wget -q "${MIRROR}kafka/0.9.0.1/kafka_2.10-0.9.0.1.tgz" -O "/tmp/kafka_2.10-0.9.0.1.tgz" && tar xfz /tmp/kafka_2.10-0.9.0.1.tgz -C /opt && mv "/opt/kafka_2.10-0.9.0.1" "/opt/kafka-0.9.0.1" -RUN wget -q "${MIRROR}kafka/0.10.0.1/kafka_2.10-0.10.0.1.tgz" -O "/tmp/kafka_2.10-0.10.0.1.tgz" && tar xfz /tmp/kafka_2.10-0.10.0.1.tgz -C /opt && mv "/opt/kafka_2.10-0.10.0.1" "/opt/kafka-0.10.0.1" -RUN wget -q "${MIRROR}kafka/0.10.1.1/kafka_2.10-0.10.1.1.tgz" -O "/tmp/kafka_2.10-0.10.1.1.tgz" && tar xfz /tmp/kafka_2.10-0.10.1.1.tgz -C /opt && mv "/opt/kafka_2.10-0.10.1.1" "/opt/kafka-0.10.1.1" -RUN rm /tmp/kafka_*.tgz ADD ssh /root/.ssh RUN chmod 600 /root/.ssh/id_rsa +RUN apt update && apt install -y unzip wget curl jq coreutils openssh-server net-tools vim openjdk-8-jdk python-pip python-dev libffi-dev libssl-dev +RUN pip install -U pip && pip install --upgrade cffi ducktape==0.6.0 +RUN mkdir -p "/opt/kafka_2.10-0.8.2.2" && curl "${MIRROR}kafka/0.8.2.2/kafka_2.10-0.8.2.2.tgz" | tar xz --strip-components=1 -C "/opt/kafka_2.10-0.8.2.2" +RUN mkdir -p "/opt/kafka_2.10-0.9.0.1" && curl "${MIRROR}kafka/0.9.0.1/kafka_2.10-0.9.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka_2.10-0.9.0.1" +RUN mkdir -p "/opt/kafka_2.10-0.10.0.1" && curl "${MIRROR}kafka/0.10.0.1/kafka_2.10-0.10.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka_2.10-0.10.0.1" +RUN mkdir -p "/opt/kafka_2.10-0.10.1.1" && curl "${MIRROR}kafka/0.10.1.1/kafka_2.10-0.10.1.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka_2.10-0.10.1.1" CMD service ssh start && tail -f /dev/null diff --git a/tests/docker/run_tests.sh b/tests/docker/run_tests.sh index 0e5378a8f..cc381cc33 100755 --- a/tests/docker/run_tests.sh +++ b/tests/docker/run_tests.sh @@ -46,7 +46,7 @@ fi echo "Using kafka image: ${KAFKA_IMAGE}" docker inspect ${KAFKA_IMAGE} for i in $(seq -w 1 ${KAFKA_NUM_CONTAINERS}); do - docker run -d -t --name knode${i} --network knw -v ${KAFKA_SRC}:/kafka_src ${KAFKA_IMAGE} + docker run -d -t --name knode${i} --network knw -v ${KAFKA_SRC}:/opt/kafka-dev ${KAFKA_IMAGE} done docker info @@ -55,18 +55,8 @@ docker network inspect knw for i in $(seq -w 1 ${KAFKA_NUM_CONTAINERS}); do echo knode${i} - docker exec knode${i} bash -c "(tar xfz /kafka_src/core/build/distributions/kafka_*SNAPSHOT.tgz -C /opt || echo missing kafka tgz did you build kafka tarball) && mv /opt/kafka*SNAPSHOT /opt/kafka-dev && ls -l /opt" - docker exec knode01 bash -c "ssh knode$i hostname" -done - -# hack to copy test dependencies -# this is required for running MiniKDC -(cd ${KAFKA_SRC} && ./gradlew copyDependantTestLibs) -for i in $(seq -w 1 ${KAFKA_NUM_CONTAINERS}); do - echo knode${i} - docker exec knode${i} bash -c "cp /kafka_src/core/build/dependant-testlibs/* /opt/kafka-dev/libs/" docker exec knode01 bash -c "ssh knode$i hostname" done bash tests/cluster_file_generator.sh > tests/cluster_file.json -docker exec knode01 bash -c "cd /kafka_src; ducktape ${_DUCKTAPE_OPTIONS} --cluster-file tests/cluster_file.json ${TC_PATHS:-tests/kafkatest/tests}" +docker exec knode01 bash -c "cd /opt/kafka-dev; ducktape ${_DUCKTAPE_OPTIONS} --cluster-file tests/cluster_file.json ${TC_PATHS:-tests/kafkatest/tests}" diff --git a/tests/kafkatest/sanity_checks/test_verifiable_producer.py b/tests/kafkatest/sanity_checks/test_verifiable_producer.py index b4ca4e94f..be1057471 100644 --- a/tests/kafkatest/sanity_checks/test_verifiable_producer.py +++ b/tests/kafkatest/sanity_checks/test_verifiable_producer.py @@ -23,7 +23,7 @@ from kafkatest.services.kafka import KafkaService from kafkatest.services.verifiable_producer import VerifiableProducer from kafkatest.services.zookeeper import ZookeeperService from kafkatest.utils import is_version -from kafkatest.version import LATEST_0_8_2, LATEST_0_9, DEV_BRANCH, KafkaVersion +from kafkatest.version import LATEST_0_8_2, LATEST_0_9, LATEST_0_10_0, LATEST_0_10_1, DEV_BRANCH, KafkaVersion class TestVerifiableProducer(Test): @@ -48,6 +48,8 @@ class TestVerifiableProducer(Test): @cluster(num_nodes=3) @parametrize(producer_version=str(LATEST_0_8_2)) @parametrize(producer_version=str(LATEST_0_9)) + @parametrize(producer_version=str(LATEST_0_10_0)) + @parametrize(producer_version=str(LATEST_0_10_1)) @parametrize(producer_version=str(DEV_BRANCH)) def test_simple_run(self, producer_version=DEV_BRANCH): """