Exemplo n.º 1
0
    def test_create_and_list_qos_with_fails(self):
        mock_service = self.mock_cinder.return_value
        qos = mock.MagicMock()
        list_qos = [mock.MagicMock(),
                    mock.MagicMock(),
                    mock.MagicMock()]
        specs = {"consumer": "both",
                 "write_iops_sec": "10",
                 "read_iops_sec": "1000"}

        scenario = qos_specs.CreateAndListQos(self._get_context())
        mock_service.create_qos.return_value = qos
        mock_service.list_qos.return_value = list_qos

        self.assertRaises(rally_exceptions.RallyAssertionError,
                          scenario.run, specs)
        mock_service.create_qos.assert_called_once_with(specs)
        mock_service.list_qos.assert_called_once_with()
Exemplo n.º 2
0
    def test_create_and_list_qos(self):
        mock_service = self.mock_cinder.return_value
        qos = mock.MagicMock()
        list_qos = [mock.MagicMock(),
                    mock.MagicMock(),
                    qos]

        specs = {"consumer": "both",
                 "write_iops_sec": "10",
                 "read_iops_sec": "1000"}

        scenario = qos_specs.CreateAndListQos(self._get_context())
        mock_service.create_qos.return_value = qos
        mock_service.list_qos.return_value = list_qos

        scenario.run(specs)
        mock_service.create_qos.assert_called_once_with(specs)
        mock_service.list_qos.assert_called_once_with()