Bug #100019 myql-test/include/check_ipv6.inc can not full-check the ipv6 support.
Submitted: 27 Jun 2020 16:27 Modified: 29 Jul 2020 13:37
Reporter: miao ma Email Updates:
Status: No Feedback Impact on me:
None 
Category:Tests Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[27 Jun 2020 16:27] miao ma
Description:
in myql-test/include/check_ipv6.inc, it can check whether system can support ipv6 by connect (checkcon123456789,::1,root,,);, but there are some cases, this call will return error, but the system can support ipv6:
for example:
ERROR 2003 (HY000): Can't connect to MySQL server on '::1' (99) 
but mysql server in that system could start with "IPV6 is available".
you can notice that the return error is 99 which is caused by sysctl of net.ipv6.conf.default.disable_ipv6 set.

So i think we should check the network return value which is 97,  
to check whether the system can support ipv6. When the system is not supporting ipv6, the return error is 97, which is Can't create TCP/IP socket.

How to repeat:
to set net.ipv6.conf.default.disable_ipv6 = 1

the mysql server start with :
"IPV6 is available".
"Server socket created on IP: "::""

But to test the connection_local_scope.test or other test with have_ipv6.inc, it will skipped since it found that the system can not support ipv6 , just because the sysctl of disable_ipv6 is set 1

Suggested fix:
modify the have_ipv6.inc as follow:

# Check if ipv6 is available.
#
#--disable_query_log
#--disable_result_log
--disable_abort_on_error
connect (checkcon123456789,::1,root,,test);
let $err = $mysql_errno;
if($err == 2004)
{
  skip No IPv6 support;
}
if($err == 2003)
{
  skip Please check sysctl of ipv6, and set disable_ipv6=0, then retry again;
}
connection default;
if(!$mysql_errno)
{
  disconnect checkcon123456789;
}
--enable_abort_on_error
--enable_result_log
--enable_query_log
# end check
[29 Jun 2020 13:37] MySQL Verification Team
Hi,

Thanks for the report and suggested fix. I'm not sure I agree this is a bug. If a user disabled IPV6 for whatever reason we properly deduce IPV6 is not available. What's the reason behind IPV6 not being available is not, really, in the scope of MySQL test.

Why do you think we need to behave differently?

thanks
Bogdan
[30 Jul 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".