assert wait(cephadm_module, c) == ['Set ident light for test: on']
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_mgr_save(self, _save_spec, cephadm_module):
+ def test_apply_mgr_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
spec = ServiceSpec('mgr', placement=ps)
c = cephadm_module.apply_mgr(spec)
assert wait(cephadm_module, c) == 'Scheduled mgr update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_mds_save(self, _save_spec, cephadm_module):
+ def test_apply_mds_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
spec = ServiceSpec('mds', 'fsname', placement=ps)
c = cephadm_module.apply_mds(spec)
assert wait(cephadm_module, c) == 'Scheduled mds update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_rgw_save(self, _save_spec, cephadm_module):
+ def test_apply_rgw_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
spec = ServiceSpec('rgw', 'r.z', placement=ps)
c = cephadm_module.apply_rgw(spec)
assert wait(cephadm_module, c) == 'Scheduled rgw update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_rbd_mirror_save(self, _save_spec, cephadm_module):
+ def test_apply_rbd_mirror_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
spec = ServiceSpec('rbd-mirror', placement=ps)
c = cephadm_module.apply_rbd_mirror(spec)
assert wait(cephadm_module, c) == 'Scheduled rbd-mirror update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_prometheus_save(self, _save_spec, cephadm_module):
+ def test_apply_prometheus_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
spec = ServiceSpec('prometheus', placement=ps)
c = cephadm_module.apply_prometheus(spec)
assert wait(cephadm_module, c) == 'Scheduled prometheus update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- @mock.patch("cephadm.module.SpecStore.save")
- def test_apply_node_exporter_save(self, _save_spec, cephadm_module):
+ def test_apply_node_exporter_save(self, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
- spec = ServiceSpec('node-exporter', placement=ps)
+ spec = ServiceSpec('node-exporter', placement=ps, service_id='my_exporter')
c = cephadm_module.apply_node_exporter(spec)
assert wait(cephadm_module, c) == 'Scheduled node-exporter update...'
- _save_spec.assert_called_with(spec)
+ assert wait(cephadm_module, cephadm_module.list_specs()) == [spec]
+ assert wait(cephadm_module, cephadm_module.list_specs('node-exporter.my_exporter')) == [spec]