def test_libvirt_rbd_driver_hosts(self): libvirt_driver = net.LibvirtNetVolumeDriver(self.fake_conn) connection_info = self.rbd_connection(self.vol) hosts = ['example.com', '1.2.3.4', '::1'] ports = [None, '6790', '6791'] connection_info['data']['hosts'] = hosts connection_info['data']['ports'] = ports conf = libvirt_driver.get_config(connection_info, self.disk_info) tree = conf.format_dom() self._assertNetworkAndProtocolEquals(tree) self.assertIsNone(tree.find('./source/auth')) found_hosts = tree.findall('./source/host') self.assertEqual([host.get('name') for host in found_hosts], hosts) self.assertEqual([host.get('port') for host in found_hosts], ports) libvirt_driver.disconnect_volume(connection_info, "vde")
def test_libvirt_rbd_driver_hosts(self): libvirt_driver = volume.LibvirtNetVolumeDriver(self.fake_conn) connection_info = self.rbd_connection(self.vol) hosts = ['example.com', '1.2.3.4', '::1'] ports = [None, '6790', '6791'] connection_info['data']['hosts'] = hosts connection_info['data']['ports'] = ports conf = libvirt_driver.get_config(connection_info, self.disk_info) tree = conf.format_dom() self._assertNetworkAndProtocolEquals(tree) self.assertIsNone(tree.find('./source/auth')) found_hosts = tree.findall('./source/host') self.assertEqual([host.get('name') for host in found_hosts], hosts) self.assertEqual([host.get('port') for host in found_hosts], ports) libvirt_driver.disconnect_volume(connection_info, "vde")