From 3f5d018c2d6b250992810150ef665f5815543fa3 Mon Sep 17 00:00:00 2001 From: Isabel Jimenez Date: Mon, 14 Dec 2015 16:16:56 -0500 Subject: [PATCH] moving big run to more adequate stress test Signed-off-by: Isabel Jimenez --- test/integration/mesos/api/build.bats | 1 + test/integration/mesos/api/commit.bats | 1 + test/integration/mesos/api/events.bats | 1 + test/integration/mesos/api/images.bats | 1 + test/integration/mesos/api/info.bats | 1 + test/integration/mesos/api/inspect.bats | 1 + test/integration/mesos/api/logs.bats | 1 + test/integration/mesos/api/ps.bats | 1 + test/integration/mesos/api/run.bats | 14 +-------- test/integration/mesos/api/stats.bats | 1 + .../mesos/compose/compose_helpers.bash | 1 + test/integration/mesos/mesos_helpers.bash | 2 +- test/integration/mesos/zk/zk.bats | 1 + test/stress/stress-mesos.bats | 30 +++++++++++++++++++ 14 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 test/stress/stress-mesos.bats diff --git a/test/integration/mesos/api/build.bats b/test/integration/mesos/api/build.bats index 3659d7dd7e..7a112fdf48 100644 --- a/test/integration/mesos/api/build.bats +++ b/test/integration/mesos/api/build.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/commit.bats b/test/integration/mesos/api/commit.bats index 3545e1d6a5..71f5beb67d 100644 --- a/test/integration/mesos/api/commit.bats +++ b/test/integration/mesos/api/commit.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/events.bats b/test/integration/mesos/api/events.bats index 59a6b68ff6..da7bdbe6a6 100644 --- a/test/integration/mesos/api/events.bats +++ b/test/integration/mesos/api/events.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/images.bats b/test/integration/mesos/api/images.bats index 764d577325..9f3f318dbb 100644 --- a/test/integration/mesos/api/images.bats +++ b/test/integration/mesos/api/images.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/info.bats b/test/integration/mesos/api/info.bats index ed1e843d20..db159d84d4 100644 --- a/test/integration/mesos/api/info.bats +++ b/test/integration/mesos/api/info.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/inspect.bats b/test/integration/mesos/api/inspect.bats index cf6e05d6ea..de85fb3074 100644 --- a/test/integration/mesos/api/inspect.bats +++ b/test/integration/mesos/api/inspect.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/logs.bats b/test/integration/mesos/api/logs.bats index a7369bcc20..71b242cc60 100644 --- a/test/integration/mesos/api/logs.bats +++ b/test/integration/mesos/api/logs.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/ps.bats b/test/integration/mesos/api/ps.bats index 0123313838..606159e92b 100644 --- a/test/integration/mesos/api/ps.bats +++ b/test/integration/mesos/api/ps.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/api/run.bats b/test/integration/mesos/api/run.bats index c174d94735..28ebe269e4 100644 --- a/test/integration/mesos/api/run.bats +++ b/test/integration/mesos/api/run.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { @@ -63,16 +64,3 @@ function teardown() { [ "$status" -ne 0 ] [[ "${output}" == *'resources constraints (-c and/or -m) are required by mesos'* ]] } - -@test "mesos - docker run big" { - start_docker_with_busybox 3 - start_mesos - swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT - - for i in `seq 1 100`; do - docker_swarm run -d -m 20m busybox echo $i - done - - run docker_swarm ps -aq - [ "${#lines[@]}" -eq 100 ] -} diff --git a/test/integration/mesos/api/stats.bats b/test/integration/mesos/api/stats.bats index 8e3e165bde..49cc1d2405 100644 --- a/test/integration/mesos/api/stats.bats +++ b/test/integration/mesos/api/stats.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers function teardown() { diff --git a/test/integration/mesos/compose/compose_helpers.bash b/test/integration/mesos/compose/compose_helpers.bash index 166d628baf..1da735e67e 100644 --- a/test/integration/mesos/compose/compose_helpers.bash +++ b/test/integration/mesos/compose/compose_helpers.bash @@ -1,5 +1,6 @@ #!/bin/bash +load ../../helpers load ../mesos_helpers function docker-compose_swarm() { diff --git a/test/integration/mesos/mesos_helpers.bash b/test/integration/mesos/mesos_helpers.bash index d310630b93..5926ebb543 100644 --- a/test/integration/mesos/mesos_helpers.bash +++ b/test/integration/mesos/mesos_helpers.bash @@ -1,6 +1,6 @@ #!/bin/bash -load ../../helpers +# /test/integration/helpers should be loaded before loading this file. export SWARM_MESOS_TASK_TIMEOUT=30s export SWARM_MESOS_USER=daemon diff --git a/test/integration/mesos/zk/zk.bats b/test/integration/mesos/zk/zk.bats index fb1a66f074..b516e70fd6 100644 --- a/test/integration/mesos/zk/zk.bats +++ b/test/integration/mesos/zk/zk.bats @@ -1,5 +1,6 @@ #!/usr/bin/env bats +load ../../helpers load ../mesos_helpers # Address on which the store will listen (random port between 8000 and 9000). diff --git a/test/stress/stress-mesos.bats b/test/stress/stress-mesos.bats new file mode 100644 index 0000000000..1f089d1095 --- /dev/null +++ b/test/stress/stress-mesos.bats @@ -0,0 +1,30 @@ +#!/usr/bin/env bats + +load ../integration/helpers +load ../integration/mesos/mesos_helpers + +NODES=10 +CONTAINERS=100 + +function teardown() { + swarm_manage_cleanup + stop_mesos + stop_docker +} + +@test "spawning $CONTAINERS containers on $NODES nodes" { + start_docker_with_busybox $NODES + start_mesos + swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT + + run docker_swarm info + [ "$status" -eq 0 ] + [[ "${output}" == *"Offers: ${NODES}"* ]] + + for i in `seq 1 100`; do + docker_swarm run -d -m 20m busybox echo $i + done + + run docker_swarm ps -aq + [ "${#lines[@]}" -eq $CONTAINERS ] +}