예제 #1
0
    def test_get_monitor_dirs_multiple(self):
        result = mons.get_monitor_dirs([
            '/var/lib/ceph/mon/ceph-mon-1', '/var/lib/ceph/mon/ceph-mon-3',
            '/var/lib/ceph/mon/ceph-mon-2', '/var/lib/ceph/something'
        ])

        assert result == set(['ceph-mon-1', 'ceph-mon-2', 'ceph-mon-3'])
예제 #2
0
    def test_get_monitor_dirs_nested_multiple(self):
        result = mons.get_monitor_dirs([
            '/var/lib/ceph/mon/ceph-mon-1',
            '/var/lib/ceph/mon/ceph-mon-1/nested/dir/',
            '/var/lib/ceph/mon/ceph-mon-1/other/nested',
            '/var/lib/ceph/mon/ceph-mon-2', '/var/lib/ceph/something'
        ])

        assert result == set(['ceph-mon-1', 'ceph-mon-2'])
예제 #3
0
 def test_cannot_get_monitor_dirs(self):
     result = mons.get_monitor_dirs(
         ['/var/lib/ceph/osd/ceph-osd-1', '/var/lib/ceph/something'])
     assert result == set([])