Ejemplo n.º 1
0
 def test_delete_volume_exception(self, mock_logger):
     self.mock_shade_client.delete_volume.side_effect = (
         exc.OpenStackCloudException('error message'))
     output = openstack_utils.delete_volume(self.mock_shade_client,
                                            'volume_name_or_id')
     mock_logger.error.assert_called_once()
     self.assertFalse(output)
Ejemplo n.º 2
0
    def run(self, result):
        """execute the test"""

        if not self.setup_done:
            self.setup()

        status = op_utils.delete_volume(self.cinder_client, self.volume_id)

        if status:
            LOG.info("Delete volume successful!")
        else:
            LOG.info("Delete volume failed!")
Ejemplo n.º 3
0
    def run(self, result):
        """execute the test"""

        if not self.setup_done:
            self.setup()

        status = openstack_utils.delete_volume(
            self.shade_client,
            name_or_id=self.volume_name_or_id,
            wait=self.wait,
            timeout=self.timeout)

        if not status:
            result.update({"delete_volume": 0})
            LOG.error("Delete volume failed!")
            raise exceptions.ScenarioDeleteVolumeError

        result.update({"delete_volume": 1})
        LOG.info("Delete volume successful!")
Ejemplo n.º 4
0
 def test_delete_volume_fail(self):
     self.mock_shade_client.delete_volume.return_value = False
     output = openstack_utils.delete_volume(self.mock_shade_client,
                                            'volume_name_or_id')
     self.assertFalse(output)