Smoke tests
This commit is contained in:
1 parent
efb0ead9ad
commit
4c519fc761
2 files changed
+10
-9
No files matched your search
@@ -11,19 +11,19 @@ NAME=seeone.$DOMAIN
|
|||||||
|
|
||||||
start_suite "Resolve unqualified names"
|
start_suite "Resolve unqualified names"
|
||||||
|
|
||||||
launch_dns_on $HOST1 10.2.254.1/24
|
launch_dns_on $HOST1 10.2.254.1/24 --debug
|
||||||
|
|
||||||
start_container $HOST1 $C1/24 --name=c1 -h $NAME
|
start_container $HOST1 $C1/24 --name=c1 -h $NAME
|
||||||
start_container_with_dns $HOST1 $C2/24 --name=c2 -h seetwo.$DOMAIN
|
start_container_with_dns $HOST1 $C2/24 --name=c2 -h seetwo.$DOMAIN
|
||||||
start_container_with_dns $HOST1 $C3/24 --name=c3 --dns-search=$DOMAIN
|
start_container_with_dns $HOST1 $C3/24 --name=c3 --dns-search=$DOMAIN
|
||||||
container=$(start_container_with_dns $HOST1 $C4/24)
|
container=$(start_container_with_dns $HOST1 $C4/24)
|
||||||
|
|
||||||
check() {
|
assert_dns_a_record $HOST1 c2 seeone $C1 $NAME
|
||||||
assert "exec_on $HOST1 $1 getent hosts seeone | tr -s ' '" "$C1 $NAME"
|
assert_dns_a_record $HOST1 c3 seeone $C1 $NAME
|
||||||
}
|
assert_dns_a_record $HOST1 "$container" seeone $C1 $NAME
|
||||||
|
|
||||||
check c2
|
# check that unqualified names are automatically qualified for broken resolvers
|
||||||
check c3
|
weave_on $HOST1 dns-add $C1 c1 -h mysql.weave.local
|
||||||
check "$container"
|
assert_dns_a_record $HOST1 c1 mysql $C1
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
+3
-2
@@ -188,9 +188,10 @@ assert_no_dns_record() {
|
|||||||
assert_raises "exec_on $host $container getent hosts $name" 2
|
assert_raises "exec_on $host $container getent hosts $name" 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# assert_dns_a_record <host> <container> <name> <ip>
|
# assert_dns_a_record <host> <container> <name> <ip> [<expected_name>]
|
||||||
assert_dns_a_record() {
|
assert_dns_a_record() {
|
||||||
assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3"
|
exp_name=${5:-$3}
|
||||||
|
assert "exec_on $1 $2 getent hosts $3 | tr -s ' ' | cut -d ' ' -f 1,2" "$4 $exp_name"
|
||||||
}
|
}
|
||||||
|
|
||||||
# assert_dns_ptr_record <host> <container> <name> <ip>
|
# assert_dns_ptr_record <host> <container> <name> <ip>
|
||||||
|
|||||||
Reference in new issue
Block a user