Beispiel #1
0
 def test_notify_about_consistencygroup_usage(self, mock_rpc, mock_conf, mock_usage):
     mock_conf.host = "host1"
     output = volume_utils.notify_about_consistencygroup_usage(
         mock.sentinel.context, mock.sentinel.consistencygroup, "test_suffix"
     )
     self.assertIsNone(output)
     mock_usage.assert_called_once_with(mock.sentinel.consistencygroup)
     mock_rpc.get_notifier.assert_called_once_with("consistencygroup", "host1")
     mock_rpc.get_notifier.return_value.info.assert_called_once_with(
         mock.sentinel.context, "consistencygroup.test_suffix", mock_usage.return_value
     )
Beispiel #2
0
 def test_notify_about_consistencygroup_usage(self, mock_rpc, mock_conf,
                                              mock_usage):
     mock_conf.host = 'host1'
     output = volume_utils.notify_about_consistencygroup_usage(
         mock.sentinel.context, mock.sentinel.consistencygroup,
         'test_suffix')
     self.assertIsNone(output)
     mock_usage.assert_called_once_with(mock.sentinel.consistencygroup)
     mock_rpc.get_notifier.assert_called_once_with('consistencygroup',
                                                   'host1')
     mock_rpc.get_notifier.return_value.info.assert_called_once_with(
         mock.sentinel.context, 'consistencygroup.test_suffix',
         mock_usage.return_value)
 def test_notify_about_consistencygroup_usage(self, mock_rpc,
                                              mock_conf, mock_usage):
     mock_conf.host = 'host1'
     output = volume_utils.notify_about_consistencygroup_usage(
         mock.sentinel.context,
         mock.sentinel.consistencygroup,
         'test_suffix')
     self.assertIsNone(output)
     mock_usage.assert_called_once_with(mock.sentinel.consistencygroup)
     mock_rpc.get_notifier.assert_called_once_with('consistencygroup',
                                                   'host1')
     mock_rpc.get_notifier.return_value.info.assert_called_once_with(
         mock.sentinel.context,
         'consistencygroup.test_suffix',
         mock_usage.return_value)
Beispiel #4
0
 def test_notify_about_consistencygroup_usage_with_kwargs(self, mock_rpc, mock_conf, mock_usage):
     mock_conf.host = "host1"
     output = volume_utils.notify_about_consistencygroup_usage(
         mock.sentinel.context,
         mock.sentinel.consistencygroup,
         "test_suffix",
         extra_usage_info={"a": "b", "c": "d"},
         host="host2",
     )
     self.assertIsNone(output)
     mock_usage.assert_called_once_with(mock.sentinel.consistencygroup, a="b", c="d")
     mock_rpc.get_notifier.assert_called_once_with("consistencygroup", "host2")
     mock_rpc.get_notifier.return_value.info.assert_called_once_with(
         mock.sentinel.context, "consistencygroup.test_suffix", mock_usage.return_value
     )