Merge "Add unit tests for mtc_host_add RPC EP."

This commit is contained in:
Zuul 2020-01-16 16:24:29 +00:00 committed by Gerrit Code Review
commit 737b98c456
1 changed files with 14 additions and 0 deletions

View File

@ -440,6 +440,20 @@ class ManagerTestCase(base.DbTestCase):
self.assertEqual(ret, {})
def test_mtc_host_add(self):
mock_notify_mtc_and_recv = mock.MagicMock()
p = mock.patch('sysinv.common.utils.notify_mtc_and_recv',
mock_notify_mtc_and_recv)
p.start().return_value = {'status': 'pass'}
self.addCleanup(p.stop)
ihost = {}
ihost['hostname'] = 'newhost'
ihost['personality'] = 'worker'
self.service.mtc_host_add(self.context, "localhost", 2112, ihost)
mock_notify_mtc_and_recv.assert_called_with("localhost", 2112, ihost)
def test_kube_download_images(self):
# Create an upgrade
utils.create_test_kube_upgrade(