From 93467f9a7e90646b804033d0976979f9e4512258 Mon Sep 17 00:00:00 2001 From: Chun Chen Date: Tue, 13 Oct 2015 15:52:42 +0800 Subject: [PATCH] Add overlay zookeeper test Signed-off-by: Chun Chen --- test/integration/dnet/helpers.bash | 79 ++++++++++++++++++- test/integration/dnet/overlay-consul.bats | 11 +++ test/integration/dnet/overlay-zookeeper.bats | 12 +++ test/integration/dnet/overlay.bats | 42 ---------- .../integration/dnet/run-integration-tests.sh | 50 +++++++++--- 5 files changed, 138 insertions(+), 56 deletions(-) create mode 100644 test/integration/dnet/overlay-consul.bats create mode 100644 test/integration/dnet/overlay-zookeeper.bats delete mode 100644 test/integration/dnet/overlay.bats diff --git a/test/integration/dnet/helpers.bash b/test/integration/dnet/helpers.bash index 0948710..121d74b 100644 --- a/test/integration/dnet/helpers.bash +++ b/test/integration/dnet/helpers.bash @@ -123,7 +123,27 @@ function start_dnet() { mkdir -p /tmp/dnet/${name} tomlfile="/tmp/dnet/${name}/libnetwork.toml" - cat > ${tomlfile} < ${tomlfile} < ${tomlfile} <>${INTEGRATION_ROOT}/test.log 2>&1 unset cmap[dnet-1-bridge] +## Test overlay network with consul ## Setup -start_dnet 1 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -cmap[dnet-1-overlay]=dnet-1-overlay -start_dnet 2 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -cmap[dnet-2-overlay]=dnet-2-overlay -start_dnet 3 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -cmap[dnet-3-overlay]=dnet-3-overlay +start_dnet 1 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-1-consul]=dnet-1-consul +start_dnet 2 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-2-consul]=dnet-2-consul +start_dnet 3 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-3-consul]=dnet-3-consul ## Run the test cases -./integration-tmp/bin/bats ./test/integration/dnet/overlay.bats +./integration-tmp/bin/bats ./test/integration/dnet/overlay-consul.bats ## Teardown -stop_dnet 1 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -unset cmap[dnet-1-overlay] -stop_dnet 2 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -unset cmap[dnet-2-overlay] -stop_dnet 3 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1 -unset cmap[dnet-3-overlay] +stop_dnet 1 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-1-consul] +stop_dnet 2 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-2-consul] +stop_dnet 3 consul 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-3-consul] + +## Test overlay network with zookeeper +start_zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[zookeeper_server]=zookeeper_server + +start_dnet 1 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-1-zookeeper]=dnet-1-zookeeper +start_dnet 2 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-2-zookeeper]=dnet-2-zookeeper +start_dnet 3 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +cmap[dnet-3-zookeeper]=dnet-3-zookeeper + +./integration-tmp/bin/bats ./test/integration/dnet/overlay-zookeeper.bats + +stop_dnet 1 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-1-zookeeper] +stop_dnet 2 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-2-zookeeper] +stop_dnet 3 zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[dnet-3-zookeeper] + +stop_zookeeper 1>>${INTEGRATION_ROOT}/test.log 2>&1 +unset cmap[zookeeper_server] # Suite teardowm stop_consul 1>>${INTEGRATION_ROOT}/test.log 2>&1