def keepalived_ipv6_supported():
 (br_name, ha_port, gw_port) = common_utils.get_related_rand_device_names(['ka-test-', ha_router.HA_DEV_PREFIX, namespaces.INTERNAL_DEV_PREFIX])
 gw_vip = 'fdf8:f53b:82e4::10/64'
 expected_default_gw = 'fe80:f816::1'
 with ovs_lib.OVSBridge(br_name) as br:
  with KeepalivedIPv6Test(ha_port, gw_port, gw_vip, expected_default_gw) as ka:
   br.add_port(ha_port, ('type', 'internal'))
   br.add_port(gw_port, ('type', 'internal'))
   ha_dev = ip_lib.IPDevice(ha_port)
   gw_dev = ip_lib.IPDevice(gw_port)
   ha_dev.link.set_netns(ka.nsname)
   gw_dev.link.set_netns(ka.nsname)
   ha_dev.link.set_up()
   gw_dev.link.set_up()
   ka.configure()
   ka.start_keepalived_process()
   ka.verify_ipv6_address_assignment(gw_dev)
   default_gw = gw_dev.route.get_gateway(ip_version=6)
   if default_gw:
    default_gw = default_gw['gateway']
 return (expected_default_gw == default_gw)

def keepalived_ipv6_supported ( ) : ( br_name , ha_port , gw_port ) = common_utils . get_related_rand_device_names ( [ 'ka-test-' , ha_router . HA_DEV_PREFIX , namespaces . INTERNAL_DEV_PREFIX ] ) gw_vip = 'fdf8:f53b:82e4::10/64' expected_default_gw = 'fe80:f816::1' with ovs_lib . OVSBridge ( br_name ) as br : with KeepalivedIPv6Test ( ha_port , gw_port , gw_vip , expected_default_gw ) as ka : br . add_port ( ha_port , ( 'type' , 'internal' ) ) br . add_port ( gw_port , ( 'type' , 'internal' ) ) ha_dev = ip_lib . IPDevice ( ha_port ) gw_dev = ip_lib . IPDevice ( gw_port ) ha_dev . link . set_netns ( ka . nsname ) gw_dev . link . set_netns ( ka . nsname ) ha_dev . link . set_up ( ) gw_dev . link . set_up ( ) ka . configure ( ) ka . start_keepalived_process ( ) ka . verify_ipv6_address_assignment ( gw_dev ) default_gw = gw_dev . route . get_gateway ( ip_version = 6 ) if default_gw : default_gw = default_gw [ 'gateway' ] return ( expected_default_gw == default_gw )
check if keepalived supports ipv6 functionality .