test: check ipv6 support before testing it

fix #7983
fix #8049