Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 def failed_reconfiguration_test(self):
     """Test the reconfiguration test."""
     with self.assertRaises(StorageConfigurationError):
         NVDIMMReconfigureTask("namespace0.0", "sector", 512).run()
Ejemplo n.º 5
0
 def test_failed_reconfiguration(self):
     """Test the reconfiguration test."""
     with pytest.raises(StorageConfigurationError):
         NVDIMMReconfigureTask("namespace0.0", "sector", 512).run()