1 parent
cba1827d2c
commit
ee61f07d9b
3 files changed
+9
-4
No files matched your search
@@ -10,7 +10,7 @@ DOPTS="--name=c2 -h $NAME"
|
|||||||
|
|
||||||
check() {
|
check() {
|
||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
docker_on $HOST1 rm -f c2 >/dev/null
|
rm_containers $HOST1 c2
|
||||||
assert_no_dns_record $HOST1 c1 $NAME
|
assert_no_dns_record $HOST1 c1 $NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ assert_expected_fqdn() {
|
|||||||
shift
|
shift
|
||||||
start_container_with_dns $HOST1 "$@"
|
start_container_with_dns $HOST1 "$@"
|
||||||
assert "docker_inspect_fqdn $HOST1 $NAME" $EXPECTED_FQDN
|
assert "docker_inspect_fqdn $HOST1 $NAME" $EXPECTED_FQDN
|
||||||
docker_on $HOST1 rm -f $NAME >/dev/null
|
rm_containers $HOST1 $NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
start_suite "Use container name as hostname"
|
start_suite "Use container name as hostname"
|
||||||
|
|||||||
+7
-2
@@ -111,6 +111,12 @@ start_container_with_dns() {
|
|||||||
weave_on $host run --with-dns "$@" -t $DNS_IMAGE /bin/sh
|
weave_on $host run --with-dns "$@" -t $DNS_IMAGE /bin/sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rm_containers() {
|
||||||
|
host=$1
|
||||||
|
shift
|
||||||
|
[ $# -eq 0 ] || docker_on $host rm -f "$@" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
container_ip() {
|
container_ip() {
|
||||||
weave_on $1 ps $2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
|
weave_on $1 ps $2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
|
||||||
}
|
}
|
||||||
@@ -155,8 +161,7 @@ assert_dns_ptr_record() {
|
|||||||
start_suite() {
|
start_suite() {
|
||||||
for host in $HOST1 $HOST2; do
|
for host in $HOST1 $HOST2; do
|
||||||
[ -z "$DEBUG" ] || echo "Cleaning up on $host: removing all containers and resetting weave"
|
[ -z "$DEBUG" ] || echo "Cleaning up on $host: removing all containers and resetting weave"
|
||||||
containers=$(docker_on $host ps -aq 2>/dev/null)
|
rm_containers $host $(docker_on $host ps -aq 2>/dev/null)
|
||||||
[ -n "$containers" ] && docker_on $host rm -f $containers >/dev/null 2>&1
|
|
||||||
weave_on $host reset 2>/dev/null
|
weave_on $host reset 2>/dev/null
|
||||||
done
|
done
|
||||||
whitely echo "$@"
|
whitely echo "$@"
|
||||||
|
|||||||
Reference in new issue
Block a user