Skip to content

Commit

Permalink
tests: Use IPv6 prefix reserved for documentation.
Browse files Browse the repository at this point in the history
The test suite currently have references to 2001:1db8:: prefixes,
while RFC 3849 reserves 2001:db8::/32 for documentation.

Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
fnordahl authored and dceara committed Jan 17, 2025
1 parent b738d3b commit 2998012
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
22 changes: 11 additions & 11 deletions tests/system-common-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ ADD_NAMESPACES(sw11)
ADD_VETH(sw11, sw11, br-int, "192.168.2.2/24", "f0:00:00:02:02:03", \
"192.168.2.1")
ADD_NAMESPACES(server)
ADD_VETH(s1, server, br-ext, "2001:1db8:3333::2/64", "f0:00:00:01:02:05", \
"2001:1db8:3333::1", "nodad")
ADD_VETH(s1, server, br-ext, "2001:db8:3333::2/64", "f0:00:00:01:02:05", \
"2001:db8:3333::1", "nodad")

if test X"$1" = X"GR"; then
check_uuid ovn-nbctl create Logical_Router name=R1 options:chassis=hv1
Expand Down Expand Up @@ -449,8 +449,8 @@ check ovn-nbctl --wait=hv sync
cat > /etc/dhcp/dhcpd.conf <<EOF
option dhcp-rebinding-time 10;
option dhcp-renewal-time 5;
subnet6 2001:1db8:3333::/56 {
prefix6 2001:1db8:3333:100:: 2001:1db8:3333:111:: /64;
subnet6 2001:db8:3333::/56 {
prefix6 2001:db8:3333:100:: 2001:db8:3333:111:: /64;
}
EOF
rm -f /var/lib/dhcp/dhcpd6.leases
Expand All @@ -466,14 +466,14 @@ check ovn-nbctl --wait=hv sync
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c4-15)" = ""])
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c4-15)" = ""])

AT_CHECK([ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c3-16], [0], [dnl
[2001:1db8:3333]
AT_CHECK([ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c3-15], [0], [dnl
[2001:db8:3333]
])
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16], [0], [dnl
[2001:1db8:3333]
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-15], [0], [dnl
[2001:db8:3333]
])

hex_prefix=0x20011db8
hex_prefix=0x20010db8
ovn-nbctl list logical_router_port rp-public > /tmp/rp-public

# Wait for 2 renew on each port.
Expand Down Expand Up @@ -509,8 +509,8 @@ OVS_WAIT_UNTIL([

check ovn-nbctl set logical_router_port rp-sw0 options:prefix=false
check ovn-nbctl clear logical_router_port rp-sw0 ipv6_prefix
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16)" = "[2001:1db8:3333]"])
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16], [0], [dnl
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-15)" = "[2001:db8:3333]"])
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-15], [0], [dnl
[]
])

Expand Down
36 changes: 18 additions & 18 deletions tests/system-ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -14310,8 +14310,8 @@ ovs-vsctl \
start_daemon ovn-controller

ADD_NAMESPACES(server)
ADD_VETH(s1, server, br-ext, "2001:1db8:3333::2/64", "f0:00:00:01:02:05", \
"2001:1db8:3333::1", "nodad")
ADD_VETH(s1, server, br-ext, "2001:db8:3333::2/64", "f0:00:00:01:02:05", \
"2001:db8:3333::1", "nodad")

check_uuid ovn-nbctl create Logical_Router name=R1 options:chassis=hv1

Expand Down Expand Up @@ -14356,8 +14356,8 @@ check ovn-nbctl --wait=hv sync
cat > /etc/dhcp/dhcpd.conf <<EOF
option dhcp-rebinding-time 10;
option dhcp-renewal-time 5;
subnet6 2001:1db8:3333::/56 {
prefix6 2001:1db8:3333:100:: 2001:1db8:3333:111:: /64;
subnet6 2001:db8:3333::/56 {
prefix6 2001:db8:3333:100:: 2001:db8:3333:111:: /64;
}
EOF
rm -f /var/lib/dhcp/dhcpd6.leases
Expand All @@ -14380,11 +14380,11 @@ dp sw0 : local = sw0-rp, remote = rp-sw0
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c4-15)" = ""])
OVS_WAIT_WHILE([test "$(ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c4-15)" = ""])

AT_CHECK([ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c3-16], [0], [dnl
[2001:1db8:3333]
AT_CHECK([ovn-nbctl get logical_router_port rp-public ipv6_prefix | cut -c3-15], [0], [dnl
[2001:db8:3333]
])
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-16], [0], [dnl
[2001:1db8:3333]
AT_CHECK([ovn-nbctl get logical_router_port rp-sw0 ipv6_prefix | cut -c3-15], [0], [dnl
[2001:db8:3333]
])

OVS_APP_EXIT_AND_WAIT([ovn-controller])
Expand Down Expand Up @@ -14447,7 +14447,7 @@ start_daemon ovn-controller
# Create router and switch facilitating external connectivity
check ovn-nbctl \
-- lr-add R1 \
-- lrp-add R1 lrp-r1-public 00:00:02:ff:ff:01 2001:1db8:ffff::1/64 \
-- lrp-add R1 lrp-r1-public 00:00:02:ff:ff:01 2001:db8:ffff::1/64 \
-- ls-add public \
-- lsp-add public lsp-public-r1 \
-- lsp-set-type lsp-public-r1 router \
Expand All @@ -14474,7 +14474,7 @@ check ovn-nbctl --wait=hv sync

# Create "external host"
ADD_NAMESPACES(ext1)
ADD_VETH(ext1, ext1, br-ext, "2001:1db8:ffff::2/64", "00:00:02:ff:ff:02", [], [nodad])
ADD_VETH(ext1, ext1, br-ext, "2001:db8:ffff::2/64", "00:00:02:ff:ff:02", [], [nodad])
OVS_WAIT_UNTIL([NS_EXEC([ext1], [ip a show dev ext1 | grep "fe80::" | grep -v tentative])])

# Simulate external IPv4 network "behind" external host
Expand All @@ -14483,7 +14483,7 @@ NS_CHECK_EXEC([ext1], [ip link set dummy0 up])
NS_CHECK_EXEC([ext1], [ip addr add 10.42.0.10/32 dev dummy0])

# Add IPv4 route over IPv6 next-hop to the router
check ovn-nbctl lr-route-add R1 10.42.0.10/24 2001:1db8:ffff::2 lrp-r1-public
check ovn-nbctl lr-route-add R1 10.42.0.10/24 2001:db8:ffff::2 lrp-r1-public

# Test Distributed NAT
# Create internal network and connect it to router
Expand All @@ -14506,7 +14506,7 @@ check ovn-nbctl \
check ovn-nbctl lr-nat-add R1 dnat_and_snat 172.16.10.1 192.168.100.10 alice 00:00:04:00:00:01

# Add route for R1's external SNAT/DNAT address to external host
NS_EXEC([ext1], [ip route add 172.16.10.1/32 via inet6 2001:1db8:ffff::1])
NS_EXEC([ext1], [ip route add 172.16.10.1/32 via inet6 2001:db8:ffff::1])

wait_for_ports_up
check ovn-nbctl --wait=hv sync
Expand Down Expand Up @@ -14544,7 +14544,7 @@ check ovn-nbctl \
check ovn-nbctl lr-nat-add R1 snat 172.16.10.2 192.168.200.10

# Add route for R1's external SNAT address to external host
NS_EXEC([ext1], [ip route add 172.16.10.2/32 via inet6 2001:1db8:ffff::1])
NS_EXEC([ext1], [ip route add 172.16.10.2/32 via inet6 2001:db8:ffff::1])

wait_for_ports_up
check ovn-nbctl --wait=hv sync
Expand Down Expand Up @@ -14614,7 +14614,7 @@ start_daemon ovn-controller
# Create gateway router and switch facilitating external connectivity
check ovn-nbctl \
-- lr-add R1 \
-- lrp-add R1 lrp-r1-public 00:00:02:ff:ff:01 2001:1db8:ffff::1/64 \
-- lrp-add R1 lrp-r1-public 00:00:02:ff:ff:01 2001:db8:ffff::1/64 \
-- set Logical_Router R1 options:chassis=hv1 \
-- ls-add public \
-- lsp-add public lsp-public-r1 \
Expand All @@ -14634,7 +14634,7 @@ check ovn-nbctl --wait=hv sync

# Create "external host"
ADD_NAMESPACES(ext1)
ADD_VETH(ext1, ext1, br-ext, "2001:1db8:ffff::2/64", "00:00:02:ff:ff:02", [], [nodad])
ADD_VETH(ext1, ext1, br-ext, "2001:db8:ffff::2/64", "00:00:02:ff:ff:02", [], [nodad])
OVS_WAIT_UNTIL([NS_EXEC([ext1], [ip a show dev ext1 | grep "fe80::" | grep -v tentative])])

# Simulate external IPv4 network "behind" external host
Expand All @@ -14643,7 +14643,7 @@ NS_CHECK_EXEC([ext1], [ip link set dummy0 up])
NS_CHECK_EXEC([ext1], [ip addr add 10.42.0.10/32 dev dummy0])

# Add IPv4 route over IPv6 next-hop to the router
check ovn-nbctl lr-route-add R1 10.42.0.10/24 2001:1db8:ffff::2 lrp-r1-public
check ovn-nbctl lr-route-add R1 10.42.0.10/24 2001:db8:ffff::2 lrp-r1-public

# Test dnat_and_snat NAT type
# Create internal network and connect it to router
Expand All @@ -14666,7 +14666,7 @@ check ovn-nbctl \
check ovn-nbctl lr-nat-add R1 dnat_and_snat 172.16.10.1 192.168.100.10

# Add route for R1's external SNAT/DNAT address to external host
NS_EXEC([ext1], [ip route add 172.16.10.1/32 via inet6 2001:1db8:ffff::1])
NS_EXEC([ext1], [ip route add 172.16.10.1/32 via inet6 2001:db8:ffff::1])

wait_for_ports_up
check ovn-nbctl --wait=hv sync
Expand Down Expand Up @@ -14705,7 +14705,7 @@ check ovn-nbctl \
check ovn-nbctl lr-nat-add R1 snat 172.16.10.2 192.168.200.10

# Add route for R1's external SNAT address to external host
NS_EXEC([ext1], [ip route add 172.16.10.2/32 via inet6 2001:1db8:ffff::1])
NS_EXEC([ext1], [ip route add 172.16.10.2/32 via inet6 2001:db8:ffff::1])

wait_for_ports_up
check ovn-nbctl --wait=hv sync
Expand Down

0 comments on commit 2998012

Please sign in to comment.