lego-monitoring/tests/test_disks.py
2024-11-09 12:22:12 +03:00

27 lines
802 B
Python

import unittest
from misc.disks import LVAttr
class TestDisks(unittest.TestCase):
def test_lv_attr_declaration(self):
self.assertEqual(
LVAttr.from_str("rwi-aor---", "Data/lvol0"),
LVAttr(
vol_type=LVAttr.VolType.RAID,
permissions=LVAttr.Permissions.WRITABLE,
allocation_policy=LVAttr.AllocationPolicy.INHERITED,
fixed_minor=False,
state=LVAttr.State.ACTIVE,
is_open=LVAttr.IsOpen.OPEN,
target_type=LVAttr.TargetType.RAID,
zero_before_use=False,
health=LVAttr.Health.OK,
skip_activation=False,
name="Data/lvol0",
),
)
if __name__ == "__main__":
unittest.main()