Skip to content

Commit 80d2e61

Browse files
authored
test/suites/network_zone: use static IPv6 to avoid waiting on SLAAC (#18090)
2 parents 75d6a1f + 5808787 commit 80d2e61

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

test/suites/network_zone.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ test_network_zone() {
1010
netName=lxdt$$
1111
lxc network create "${netName}" \
1212
ipv4.address=192.0.2.1/24 \
13-
ipv6.address=fd42:4242:4242:1010::1/64
13+
ipv6.address=fd42:4242:4242:1010::1/64 \
14+
ipv6.dhcp.stateful=true
1415

1516
# Create the zones
1617
! lxc network zone create /lxd.example.net || false
@@ -27,8 +28,8 @@ test_network_zone() {
2728
-c restricted.networks.zones=example.net
2829

2930
# Put an instance on the network in each project.
30-
lxc init testimage c1 --network "${netName}" -d eth0,ipv4.address=192.0.2.42
31-
lxc init testimage c2 --network "${netName}" --storage "${poolName}" -d eth0,ipv4.address=192.0.2.43 --project foo
31+
lxc init testimage c1 --network "${netName}" -d eth0,ipv4.address=192.0.2.42 -d eth0,ipv6.address=fd42:4242:4242:1010::42
32+
lxc init testimage c2 --network "${netName}" --storage "${poolName}" -d eth0,ipv4.address=192.0.2.43 -d eth0,ipv6.address=fd42:4242:4242:1010::43 --project foo
3233

3334
# Check features.networks.zones can be enabled if false in a non-empty project, but cannot be disabled again.
3435
lxc project set foo features.networks.zones=true
@@ -67,25 +68,18 @@ test_network_zone() {
6768
lxc start c1
6869
lxc start c2 --project foo
6970

70-
# Wait for IPv4 and IPv6 addresses
71-
while :; do
72-
sleep 1
73-
[ -n "$(lxc list -c6 --format=csv c1)" ] || continue
74-
break
75-
done
76-
7771
# Setup DNS peers
7872
lxc network zone set lxd.example.net peers.test.address=192.0.2.1
7973
lxc network zone set lxdfoo.example.net peers.test.address=192.0.2.1 --project=foo
8074
lxc network zone set 2.0.192.in-addr.arpa peers.test.address=192.0.2.1
8175
lxc network zone set 0.1.0.1.2.4.2.4.2.4.2.4.2.4.d.f.ip6.arpa peers.test.address=192.0.2.1
8276

8377
# Enable the DNS listener on the bridge itself
84-
lxc config set core.dns_address 192.0.2.1:8853
78+
DNS_ADDR="192.0.2.1"
79+
DNS_PORT="8853"
80+
lxc config set core.dns_address "${DNS_ADDR}:${DNS_PORT}"
8581

8682
# Check the zones
87-
DNS_ADDR="$(lxc config get core.dns_address | cut -d: -f1)"
88-
DNS_PORT="$(lxc config get core.dns_address | cut -d: -f2)"
8983
dig "@${DNS_ADDR}" -p "${DNS_PORT}" axfr lxd.example.net
9084
dig "@${DNS_ADDR}" -p "${DNS_PORT}" axfr lxd.example.net | grep "${netName}.gw.lxd.example.net.\s\+300\s\+IN\s\+A\s\+"
9185
dig "@${DNS_ADDR}" -p "${DNS_PORT}" axfr lxd.example.net | grep "c1.lxd.example.net.\s\+300\s\+IN\s\+A\s\+"

0 commit comments

Comments
 (0)