network/dhcp: correct prefix for expected IPv6 address
PATCH 1/1 network/dhcp: correct prefix for expected IPv6 address
Assuming a /64 prefix from DHCPv6 server is wrong [1], fixed dhclient sets /128 prefix.
With this patch the test also checks the configured address without the prefix, when the first check fails, and reports a more verbose message, plus shows an output from 'ip addr show $iface' command.
[1] https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1609898
--- testcases/network/dhcp/dhcp_lib.sh | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-)
testcases/network/dhcp/dhcp_lib.sh +11 -4
@@ -42,10 +42,12 @@ dhcp_lib_setup() if [ $TST_IPV6 ]; then ip_addr="fd00:1:1:2::12/64" - ip_addr_check="fd00:1:1:2::100/64" + ip_addr_check_nm="fd00:1:1:2::100" + ip_addr_check="$ip_addr_check_nm/128" else ip_addr="10.1.1.12/24" - ip_addr_check="10.1.1.100/24" + ip_addr_check_nm="10.1.1.100" + ip_addr_check="$ip_addr_check_nm/24" fi lsmod | grep -q '^veth ' && veth_loaded=yes || veth_loaded=no
@@ -141,8 +143,13 @@ test01() if [ $? -eq 0 ]; then tst_res TPASS "'$ip_addr_check' configured by DHCPv$TST_IPVER" else - tst_res TFAIL "'$ip_addr_check' not configured by DHCPv$TST_IPVER" - print_dhcp_log + if ip addr show $iface1 | grep -q $ip_addr_check_nm; then + tst_res TFAIL "'$ip_addr_check_nm' configured but has wrong prefix, expect '$ip_addr_check'" + ip addr show $iface1 + else + tst_res TFAIL "'$ip_addr_check' not configured by DHCPv$TST_IPVER" + print_dhcp_log + fi fi if [ "$wicked" ]; then
Signature · 1 line
1.7.1
PATCH 1/1 network/dhcp: correct prefix for expected IPv6 address
Hi Alexey,
Good catch, thanks for fixing it!
Quoted 1 line
testcases/network/dhcp/dhcp_lib.sh | 15 +++++++++++----
...
testcases/network/dhcp/dhcp_lib.sh dhcp_lib_setup() · line 45
Quoted 4 lines
testcases/network/dhcp/dhcp_lib.sh +1
-1if [ $TST_IPV6 ]; then ip_addr="fd00:1:1:2::12/64" - ip_addr_check="fd00:1:1:2::100/64" + ip_addr_check_nm="fd00:1:1:2::100"
Just curious what _nm stands for :).
testcases/network/dhcp/dhcp_lib.sh dhcp_lib_setup() · line 46
Quoted 1 line
testcases/network/dhcp/dhcp_lib.sh +1
-0+ ip_addr_check="$ip_addr_check_nm/128"
...
Kind regards,
Petr
PATCH 1/1 network/dhcp: correct prefix for expected IPv6 address
Hi Petr,
Quoted 5 lines · Petr Vorel
Hi Alexey,
Reviewed-by Petr Vorel <[email protected]>Good catch, thanks for fixing it!
Quoted 7 lines
Quoted 1 line
testcases/network/dhcp/dhcp_lib.sh | 15 +++++++++++----...
testcases/network/dhcp/dhcp_lib.sh dhcp_lib_setup() · line 45
Quoted 4 lines
testcases/network/dhcp/dhcp_lib.sh +1
-1if [ $TST_IPV6 ]; then ip_addr="fd00:1:1:2::12/64" - ip_addr_check="fd00:1:1:2::100/64" + ip_addr_check_nm="fd00:1:1:2::100"Just curious what
_nmstands for :).
no mask, will change it to _noprefix.
Thanks for review!
Quoted 6 lines
testcases/network/dhcp/dhcp_lib.sh dhcp_lib_setup() · line 46
Quoted 1 line
testcases/network/dhcp/dhcp_lib.sh +1
-0+ ip_addr_check="$ip_addr_check_nm/128"...
Kind regards,
Petr