Smoke test for new weave run behaviour

This commit is contained in:
Adam Harrison authored and Paul Bellamy committed 2015-06-11 10:27:34 +01:00
1 parent 108eea8b79
commit bed6a130d6
1 file changed
+26
+26
View File
@@ -0,0 +1,26 @@
#! /bin/bash
. ./config.sh
# Docker inspect hostname + domainname of container $2 on host $1
docker_inspect_fqdn() {
docker_on $1 inspect --format='{{.Config.Hostname}}.{{.Config.Domainname}}' $2
}
start_suite "Use container name as hostname"
weave_on $HOST1 launch -iprange 10.2.0.0/24
start_container_with_dns $HOST1 --name=c1-name
start_container_with_dns $HOST1 --name=c2-name -h c2-hostname.weave.local
start_container_with_dns $HOST1 --name=c3-name --hostname=c3-hostname.weave.local
start_container_with_dns $HOST1 -h c4-hostname.weave.local --name=c4-name
start_container_with_dns $HOST1 --hostname=c5-hostname.weave.local --name=c5-name
assert "docker_inspect_fqdn $HOST1 c1-name" "c1-name.weave.local"
assert "docker_inspect_fqdn $HOST1 c2-name" "c2-hostname.weave.local"
assert "docker_inspect_fqdn $HOST1 c3-name" "c3-hostname.weave.local"
assert "docker_inspect_fqdn $HOST1 c4-name" "c4-hostname.weave.local"
assert "docker_inspect_fqdn $HOST1 c5-name" "c5-hostname.weave.local"
end_suite