def test_clean_storage_unmount(self): 'It unmounts block device when cleaning storage' self.is_lvm_physical_volume.return_value = False self.zap_disk.return_value = True self.mounts.return_value = MOUNTS cinder_utils.clean_storage('/dev/fakevbd') self.umount.called_with('/dev/fakevbd', True)
def test_clean_storage_lvm_wipe(self): '''It removes traces of LVM when cleaning storage''' self.mounts.return_value = [] self.is_lvm_physical_volume.return_value = True cinder_utils.clean_storage('/dev/vdb') self.remove_lvm_physical_volume.assert_called_with('/dev/vdb') self.deactivate_lvm_volume_group.assert_called_with('/dev/vdb')
def test_clean_storage_lvm_wipe(self): 'It removes traces of LVM when cleaning storage' self.mounts.return_value = [] self.is_lvm_physical_volume.return_value = True cinder_utils.clean_storage('/dev/fakevbd') self.remove_lvm_physical_volume.assert_called_with('/dev/fakevbd') self.deactivate_lvm_volume_group.assert_called_with('/dev/fakevbd') self.zap_disk.assert_called_with('/dev/fakevbd')
def install(): execd_preinstall() conf = config() src = conf['openstack-origin'] if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-folsom' configure_installation_source(src) apt_update() apt_install(determine_packages(), fatal=True) if (service_enabled('volume') and conf['block-device'] not in [None, 'None', 'none']): bdev = ensure_block_device(conf['block-device']) juju_log('Located valid block device: %s' % bdev) if conf['overwrite'] in ['true', 'True', True]: juju_log('Ensuring block device is clean: %s' % bdev) clean_storage(bdev) prepare_lvm_storage(bdev, conf['volume-group'])
def test_clean_storage_zap_disk(self): 'It removes traces of LVM when cleaning storage' self.mounts.return_value = [] self.is_lvm_physical_volume.return_value = False cinder_utils.clean_storage('/dev/fakevbd') self.zap_disk.assert_called_with('/dev/fakevbd')