mirror of https://github.com/docker/docs.git
Merge pull request #581 from chanwit/test-file-discovery
integration: test for file discovery
This commit is contained in:
commit
7c62291d47
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load helpers
|
||||||
|
|
||||||
|
# create a blank temp file for discovery
|
||||||
|
DISCOVERY_FILE=$(mktemp)
|
||||||
|
|
||||||
|
function teardown() {
|
||||||
|
swarm_manage_cleanup
|
||||||
|
rm -f $DISCOVERY_FILE
|
||||||
|
stop_docker
|
||||||
|
}
|
||||||
|
|
||||||
|
function setup_file_discovery() {
|
||||||
|
for host in ${HOSTS[@]}; do
|
||||||
|
echo "$host" >> $DISCOVERY_FILE
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "docker info should return the number of nodes with file discovery" {
|
||||||
|
start_docker 2
|
||||||
|
setup_file_discovery
|
||||||
|
swarm_manage file://$DISCOVERY_FILE
|
||||||
|
|
||||||
|
run docker_swarm info
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ "${lines[3]}" == *"Nodes: 2" ]]
|
||||||
|
}
|
Loading…
Reference in New Issue