Merge pull request #702 from aluzzardi/integration-fix-exec

DO NOT MERGE - Integration fix exec
This commit is contained in:
Andrea Luzzardi 2015-05-04 13:44:35 -07:00
commit aa98a1d5c3
2 changed files with 13 additions and 9 deletions

View File

@ -108,8 +108,7 @@ function teardown() {
[[ "${lines[1]}" == *"Up"* ]] [[ "${lines[1]}" == *"Up"* ]]
# grab the checksum of the test file inside the container. # grab the checksum of the test file inside the container.
# FIXME: if issue #658 solved, use 'exec' instead of 'exec -i' run docker_swarm exec test_container md5sum $test_file
run docker_swarm exec -i test_container md5sum $test_file
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "${#lines[@]}" -ge 1 ] [ "${#lines[@]}" -ge 1 ]
@ -199,8 +198,7 @@ function teardown() {
[[ "${lines[1]}" == *"Up"* ]] [[ "${lines[1]}" == *"Up"* ]]
[[ "${lines[1]}" != *"Paused"* ]] [[ "${lines[1]}" != *"Paused"* ]]
# FIXME: if issue #658 solved, use 'exec' instead of 'exec -i' run docker_swarm exec test_container ls
run docker_swarm exec -i test_container ls
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "${#lines[@]}" -ge 2 ] [ "${#lines[@]}" -ge 2 ]
[[ "${lines[0]}" == *"bin"* ]] [[ "${lines[0]}" == *"bin"* ]]

View File

@ -140,12 +140,18 @@ function start_docker() {
for ((i=current; i < (current + instances); i++)); do for ((i=current; i < (current + instances); i++)); do
local port=$(($BASE_PORT + $i)) local port=$(($BASE_PORT + $i))
HOSTS[$i]=127.0.0.1:$port HOSTS[$i]=127.0.0.1:$port
DOCKER_CONTAINERS[$i]=$(docker run -d --name node-$i -h node-$i --privileged \
-p 127.0.0.1:$port:$port -it \ # We have to manually call `hostname` since --hostname and --net cannot
# be used together.
DOCKER_CONTAINERS[$i]=$(
docker run -d --name node-$i --privileged -it --net=host \
${DOCKER_IMAGE}:${DOCKER_VERSION} \ ${DOCKER_IMAGE}:${DOCKER_VERSION} \
docker -d -H 0.0.0.0:$port \ bash -c "\
--storage-driver=$STORAGE_DRIVER --exec-driver=$EXEC_DRIVER \ hostname node-$i && \
"$@") docker -d -H 127.0.0.1:$port \
--storage-driver=$STORAGE_DRIVER --exec-driver=$EXEC_DRIVER \
`join ' ' $@` \
")
done done
# Wait for the engines to be reachable. # Wait for the engines to be reachable.