Beispiel #1
0
    def test_remove_osds(self, cephadm_module):
        with with_host(cephadm_module, 'test'):
            c = cephadm_module.list_daemons(refresh=True)
            wait(cephadm_module, c)

            c = cephadm_module.remove_daemons(['osd.0'])
            out = wait(cephadm_module, c)
            assert out == ["Removed osd.0 from host 'test'"]

            cephadm_module.to_remove_osds.enqueue(
                OSD(osd_id=0,
                    replace=False,
                    force=False,
                    hostname='test',
                    fullname='osd.0',
                    process_started_at=datetime.datetime.utcnow(),
                    remove_util=cephadm_module.rm_util))
            cephadm_module.rm_util.process_removal_queue()
            assert cephadm_module.to_remove_osds == OSDQueue()

            c = cephadm_module.remove_osds_status()
            out = wait(cephadm_module, c)
            assert out == []
Beispiel #2
0
 def test_rm(self, exist, stop, osd_obj):
     q = OSDQueue()
     q.add(osd_obj)
     q.rm(osd_obj)
     osd_obj.stop.assert_called_once()
Beispiel #3
0
 def test_rm_raise(self, exist, stop, osd_obj):
     q = OSDQueue()
     with pytest.raises(KeyError):
         q.rm(osd_obj)
         osd_obj.stop.assert_called_once()
Beispiel #4
0
 def test_enqueue(self, exist, start, osd_obj):
     q = OSDQueue()
     q.enqueue(osd_obj)
     osd_obj.start.assert_called_once()
Beispiel #5
0
 def test_queue_size(self, osd_obj):
     q = OSDQueue()
     assert q.queue_size() == 0
     q.add(osd_obj)
     assert q.queue_size() == 1