public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address
@ 2019-04-03 17:02 Alexey Kodanev
  2019-04-04 14:44 ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2019-04-03 17:02 UTC (permalink / raw)
  To: ltp

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

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/dhcp/dhcp_lib.sh |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/testcases/network/dhcp/dhcp_lib.sh b/testcases/network/dhcp/dhcp_lib.sh
index c92117f..434ac1d 100755
--- a/testcases/network/dhcp/dhcp_lib.sh
+++ b/testcases/network/dhcp/dhcp_lib.sh
@@ -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
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address
  2019-04-03 17:02 [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address Alexey Kodanev
@ 2019-04-04 14:44 ` Petr Vorel
  2019-04-05 10:21   ` Alexey Kodanev
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2019-04-04 14:44 UTC (permalink / raw)
  To: ltp

Hi Alexey,

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Good catch, thanks for fixing it!

>  testcases/network/dhcp/dhcp_lib.sh |   15 +++++++++++----
...
>  	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"
Just curious what _nm stands for :).
> +		ip_addr_check="$ip_addr_check_nm/128"
...

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address
  2019-04-04 14:44 ` Petr Vorel
@ 2019-04-05 10:21   ` Alexey Kodanev
  0 siblings, 0 replies; 3+ messages in thread
From: Alexey Kodanev @ 2019-04-05 10:21 UTC (permalink / raw)
  To: ltp

Hi Petr,
On 04.04.2019 17:44, Petr Vorel wrote:
> Hi Alexey,
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Good catch, thanks for fixing it!
> 
>>  testcases/network/dhcp/dhcp_lib.sh |   15 +++++++++++----
> ...
>>  	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"
> Just curious what _nm stands for :).

no mask, will change it to _noprefix.

Thanks for review!

>> +		ip_addr_check="$ip_addr_check_nm/128"
> ...
> 
> Kind regards,
> Petr
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-05 10:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-03 17:02 [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address Alexey Kodanev
2019-04-04 14:44 ` Petr Vorel
2019-04-05 10:21   ` Alexey Kodanev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox