From 5a39d2170718efc6213aa8c97a7e63eb8561bead Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 12 Jun 2015 17:15:32 -0700 Subject: [PATCH] use random port in mesos tests Signed-off-by: Victor Vieux --- test/integration/helpers.bash | 1 + test/integration/mesos/mesos_helpers.bash | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/integration/helpers.bash b/test/integration/helpers.bash index 787e6b876d..b510a5dc55 100644 --- a/test/integration/helpers.bash +++ b/test/integration/helpers.bash @@ -161,6 +161,7 @@ function start_docker() { for ((i=current; i < (current + instances); i++)); do local port=$(($BASE_PORT + $i)) HOSTS[$i]=127.0.0.1:$port + PORTS[$i]=$port # We have to manually call `hostname` since --hostname and --net cannot # be used together. diff --git a/test/integration/mesos/mesos_helpers.bash b/test/integration/mesos/mesos_helpers.bash index 7575d62d73..7546caf2a5 100644 --- a/test/integration/mesos/mesos_helpers.bash +++ b/test/integration/mesos/mesos_helpers.bash @@ -4,7 +4,6 @@ load ../helpers MESOS_IMAGE=jimenez/mesos-dev:clang MESOS_MASTER_PORT=$(( ( RANDOM % 1000 ) + 10000 )) -BASE_PORT=2375 # Start mesos master and slave. function start_mesos() { @@ -17,9 +16,8 @@ function start_mesos() { MESOS_SLAVE=$( docker_host run --privileged -d --name mesos-slave --volumes-from node-0 -e DOCKER_HOST="${HOSTS[0]}" -v /sys/fs/cgroup:/sys/fs/cgroup --net=host \ - $MESOS_IMAGE /mesos/build/bin/mesos-slave.sh --master=127.0.0.1:$MESOS_MASTER_PORT --containerizers=docker --hostname=127.0.0.1 --port=$(($MESOS_MASTER_PORT + 1)) + $MESOS_IMAGE /mesos/build/bin/mesos-slave.sh --master=127.0.0.1:$MESOS_MASTER_PORT --containerizers=docker --attributes="docker_port:${PORTS[0]}" --hostname=127.0.0.1 --port=$(($MESOS_MASTER_PORT + 1)) ) - retry 10 1 eval "docker_host ps | grep 'mesos-slave'" }