def test_reconfiguration(self, nvdimm): """Test the reconfiguration test.""" NVDIMMReconfigureTask("namespace0.0", "sector", sector_size=512).run() nvdimm.reconfigure_namespace.assert_called_once_with("namespace0.0", "sector", sector_size=512)
def reconfigure_with_task(self, namespace, mode, sector_size): """Reconfigure a namespace. :param namespace: a device name of a namespace (e.g. 'namespace0.0') :param mode: a new mode (one of 'sector', 'memory', 'dax') :param sector_size: a sector size for the sector mode :return: a task """ task = NVDIMMReconfigureTask(namespace, mode, sector_size) task.succeeded_signal.connect( lambda: self.update_action(namespace, mode, sector_size)) return task
def reconfiguration_test(self, nvdimm): """Test the reconfiguration test.""" NVDIMMReconfigureTask("namespace0.0", "sector", 512).run() nvdimm.reconfigure_namespace.called_once_with("namespace0.0", "sector", 512)
def failed_reconfiguration_test(self): """Test the reconfiguration test.""" with self.assertRaises(StorageConfigurationError): NVDIMMReconfigureTask("namespace0.0", "sector", 512).run()
def test_failed_reconfiguration(self): """Test the reconfiguration test.""" with pytest.raises(StorageConfigurationError): NVDIMMReconfigureTask("namespace0.0", "sector", 512).run()