|
@@ -2,12 +2,23 @@
|
|
|
|
|
|
set -e
|
|
set -e
|
|
|
|
|
|
-if [ ! -d ./integration-tmp ]; then
|
|
|
|
- mkdir -p ./integration-tmp
|
|
|
|
- git clone https://github.com/sstephenson/bats.git ./integration-tmp/bats
|
|
|
|
|
|
+export INTEGRATION_ROOT=./integration-tmp
|
|
|
|
+export TMPC_ROOT=./integration-tmp/tmpc
|
|
|
|
+
|
|
|
|
+if [ ! -d ${INTEGRATION_ROOT} ]; then
|
|
|
|
+ mkdir -p ${INTEGRATION_ROOT}
|
|
|
|
+ git clone https://github.com/sstephenson/bats.git ${INTEGRATION_ROOT}/bats
|
|
./integration-tmp/bats/install.sh ./integration-tmp
|
|
./integration-tmp/bats/install.sh ./integration-tmp
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+if [ ! -d ${TMPC_ROOT} ]; then
|
|
|
|
+ mkdir -p ${TMPC_ROOT}
|
|
|
|
+ docker pull busybox:ubuntu
|
|
|
|
+ docker export $(docker create busybox:ubuntu) > ${TMPC_ROOT}/busybox.tar
|
|
|
|
+ mkdir -p ${TMPC_ROOT}/rootfs
|
|
|
|
+ tar -C ${TMPC_ROOT}/rootfs -xf ${TMPC_ROOT}/busybox.tar
|
|
|
|
+fi
|
|
|
|
+
|
|
declare -A cmap
|
|
declare -A cmap
|
|
|
|
|
|
trap "cleanup_containers" EXIT SIGINT
|
|
trap "cleanup_containers" EXIT SIGINT
|
|
@@ -27,7 +38,7 @@ function cleanup_containers() {
|
|
source ./test/integration/dnet/helpers.bash
|
|
source ./test/integration/dnet/helpers.bash
|
|
|
|
|
|
# Suite setup
|
|
# Suite setup
|
|
-start_consul 1>/dev/null 2>&1
|
|
|
|
|
|
+start_consul 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
cmap[pr_consul]=pr_consul
|
|
cmap[pr_consul]=pr_consul
|
|
|
|
|
|
# Test dnet configuration options
|
|
# Test dnet configuration options
|
|
@@ -36,37 +47,56 @@ cmap[pr_consul]=pr_consul
|
|
# Test a single node configuration with a global scope test driver
|
|
# Test a single node configuration with a global scope test driver
|
|
|
|
|
|
## Setup
|
|
## Setup
|
|
-start_dnet 1 simple 1>/dev/null 2>&1
|
|
|
|
|
|
+start_dnet 1 simple 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
cmap[dnet-1-simple]=dnet-1-simple
|
|
cmap[dnet-1-simple]=dnet-1-simple
|
|
|
|
|
|
## Run the test cases
|
|
## Run the test cases
|
|
./integration-tmp/bin/bats ./test/integration/dnet/simple.bats
|
|
./integration-tmp/bin/bats ./test/integration/dnet/simple.bats
|
|
|
|
|
|
## Teardown
|
|
## Teardown
|
|
-stop_dnet 1 simple 1>/dev/null 2>&1
|
|
|
|
|
|
+stop_dnet 1 simple 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
unset cmap[dnet-1-simple]
|
|
unset cmap[dnet-1-simple]
|
|
|
|
|
|
# Test multi node configuration with a global scope test driver
|
|
# Test multi node configuration with a global scope test driver
|
|
|
|
|
|
## Setup
|
|
## Setup
|
|
-start_dnet 1 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+start_dnet 1 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
cmap[dnet-1-multi]=dnet-1-multi
|
|
cmap[dnet-1-multi]=dnet-1-multi
|
|
-start_dnet 2 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+start_dnet 2 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
cmap[dnet-2-multi]=dnet-2-multi
|
|
cmap[dnet-2-multi]=dnet-2-multi
|
|
-start_dnet 3 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+start_dnet 3 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
cmap[dnet-3-multi]=dnet-3-multi
|
|
cmap[dnet-3-multi]=dnet-3-multi
|
|
|
|
|
|
## Run the test cases
|
|
## Run the test cases
|
|
./integration-tmp/bin/bats ./test/integration/dnet/multi.bats
|
|
./integration-tmp/bin/bats ./test/integration/dnet/multi.bats
|
|
|
|
|
|
## Teardown
|
|
## Teardown
|
|
-stop_dnet 1 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+stop_dnet 1 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
unset cmap[dnet-1-multi]
|
|
unset cmap[dnet-1-multi]
|
|
-stop_dnet 2 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+stop_dnet 2 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
unset cmap[dnet-2-multi]
|
|
unset cmap[dnet-2-multi]
|
|
-stop_dnet 3 multi 1>/dev/null 2>&1
|
|
|
|
|
|
+stop_dnet 3 multi 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
unset cmap[dnet-3-multi]
|
|
unset cmap[dnet-3-multi]
|
|
|
|
|
|
|
|
+## Setup
|
|
|
|
+start_dnet 1 overlay 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
|
|
+cmap[dnet-1-overlay]=dnet-1-overlay
|
|
|
|
+start_dnet 2 overlay $(docker inspect --format '{{.NetworkSettings.IPAddress}}' dnet-1-overlay) 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
|
|
+cmap[dnet-2-overlay]=dnet-2-overlay
|
|
|
|
+start_dnet 3 overlay $(docker inspect --format '{{.NetworkSettings.IPAddress}}' dnet-2-overlay) 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
|
|
+cmap[dnet-3-overlay]=dnet-3-overlay
|
|
|
|
+
|
|
|
|
+## Run the test cases
|
|
|
|
+./integration-tmp/bin/bats ./test/integration/dnet/overlay.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]
|
|
|
|
+
|
|
# Suite teardowm
|
|
# Suite teardowm
|
|
-stop_consul 1>/dev/null 2>&1
|
|
|
|
|
|
+stop_consul 1>>${INTEGRATION_ROOT}/test.log 2>&1
|
|
unset cmap[pr_consul]
|
|
unset cmap[pr_consul]
|