Ejemplo n.º 1
0
    def test_partlabel_blkid(self, device_info):
        lsblk = {"PARTLABEL": ""}
        blkid = {"PARTLABEL": "ceph data"}
        device_info(lsblk=lsblk, blkid=blkid)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.partlabel == 'ceph data'
Ejemplo n.º 2
0
    def test_is_member_blkid(self, device_info, label):
        lsblk = {"PARTLABEL": ""}
        blkid = {"PARTLABEL": label}
        device_info(lsblk=lsblk, blkid=blkid)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 3
0
    def test_partlabel_blkid(self, fake_call, device_info):
        lsblk = {"TYPE": "disk", "NAME": "sda", "PARTLABEL": "ceph data"}
        blkid = {"TYPE": "disk", "PARTLABEL": "ceph data"}
        device_info(blkid=blkid, lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.partlabel == 'ceph data'
Ejemplo n.º 4
0
    def test_is_member_lsblk(self, fake_call, patch_bluestore_label,
                             device_info):
        lsblk = {"TYPE": "disk", "NAME": "sda", "PARTLABEL": "ceph"}
        device_info(lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 5
0
    def test_type_lsblk(self, device_info, label):
        expected = label.split()[-1].split('.')[-1]
        lsblk = {"PARTLABEL": label}
        blkid = {"PARTLABEL": ''}
        device_info(lsblk=lsblk, blkid=blkid)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type == expected
Ejemplo n.º 6
0
    def test_unknown_type(self, device_info):
        lsblk = {"PARTLABEL": "gluster"}
        device_info(lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type == 'unknown'
Ejemplo n.º 7
0
    def test_is_member_lsblk(self):
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 8
0
    def test_is_member_blkid(self, monkeypatch):
        monkeypatch.setattr("ceph_volume.util.device.disk.lsblk",
                            lambda path: {'PARTLABEL': ""})
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 9
0
    def test_partlabel_lsblk(self, device_info):
        lsblk = {"PARTLABEL": ""}
        device_info(lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.partlabel == ''
Ejemplo n.º 10
0
    def test_type_blkid(self, monkeypatch, device_info, ceph_partlabel):
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type in self.ceph_types
Ejemplo n.º 11
0
    def test_partlabel_blkid(self, device_info):
        blkid = {"TYPE": "disk", "PARTLABEL": "ceph data"}
        device_info(blkid=blkid)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.partlabel == 'ceph data'
Ejemplo n.º 12
0
    def test_unknown_type(self, fake_call, device_info):
        lsblk = {"TYPE": "disk", "NAME": "sda", "PARTLABEL": "gluster"}
        device_info(lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type == 'unknown'
Ejemplo n.º 13
0
    def test_is_member_blkid(self, fake_call, monkeypatch):
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 14
0
    def test_type_blkid(self, monkeypatch, device_info, ceph_partlabel):
        monkeypatch.setattr("ceph_volume.util.device.disk.lsblk",
                            lambda path: {'PARTLABEL': ''})
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type in self.ceph_types
Ejemplo n.º 15
0
    def test_is_member_blkid(self, monkeypatch, patch_bluestore_label):
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.is_member is True
Ejemplo n.º 16
0
    def test_type_lsblk(self, device_info, ceph_partlabel):
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.type in self.ceph_types
Ejemplo n.º 17
0
    def test_partlabel_lsblk(self, fake_call, device_info):
        lsblk = {"TYPE": "disk", "NAME": "sda", "PARTLABEL": ""}
        device_info(lsblk=lsblk)
        disk = device.CephDiskDevice(device.Device("/dev/sda"))

        assert disk.partlabel == ''