dissect.volume 3.16.dev1__tar.gz → 3.17.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/PKG-INFO +3 -4
  2. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/ddf/ddf.py +1 -1
  3. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/disk.py +1 -1
  4. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/partition.py +35 -15
  5. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/schemes/apm.py +1 -1
  6. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/schemes/bsd.py +6 -7
  7. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/schemes/gpt.py +3 -2
  8. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/schemes/mbr.py +1 -2
  9. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/lvm/metadata.py +3 -20
  10. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/raid/stream.py +1 -1
  11. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect.volume.egg-info/PKG-INFO +3 -4
  12. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect.volume.egg-info/SOURCES.txt +17 -11
  13. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/pyproject.toml +25 -8
  14. dissect_volume-3.17.dev2/tests/ddf/__init__.py +0 -0
  15. dissect_volume-3.17.dev2/tests/disk/__init__.py +0 -0
  16. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/disk}/test_bsd.py +7 -0
  17. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/disk}/test_gpt.py +33 -16
  18. dissect_volume-3.17.dev2/tests/dm/__init__.py +0 -0
  19. dissect_volume-3.17.dev2/tests/lvm/__init__.py +0 -0
  20. dissect_volume-3.17.dev2/tests/md/__init__.py +0 -0
  21. dissect_volume-3.17.dev2/tests/vinum/__init__.py +0 -0
  22. dissect_volume-3.16.dev1/tests/test_vinum_config.py → dissect_volume-3.17.dev2/tests/vinum/test_config.py +2 -2
  23. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tox.ini +8 -10
  24. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/.git-blame-ignore-revs +0 -0
  25. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/.gitattributes +0 -0
  26. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/COPYRIGHT +0 -0
  27. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/LICENSE +0 -0
  28. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/MANIFEST.in +0 -0
  29. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/README.md +0 -0
  30. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/__init__.py +0 -0
  31. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/ddf/__init__.py +0 -0
  32. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/ddf/c_ddf.py +0 -0
  33. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/__init__.py +0 -0
  34. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/disk/schemes/__init__.py +0 -0
  35. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/dm/__init__.py +0 -0
  36. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/dm/btree.py +0 -0
  37. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/dm/c_dm.py +0 -0
  38. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/dm/thin.py +0 -0
  39. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/exceptions.py +0 -0
  40. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/ldm.py +0 -0
  41. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/lvm/__init__.py +0 -0
  42. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/lvm/c_lvm2.py +0 -0
  43. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/lvm/lvm2.py +0 -0
  44. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/lvm/physical.py +0 -0
  45. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/md/__init__.py +0 -0
  46. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/md/c_md.py +0 -0
  47. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/md/md.py +0 -0
  48. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/raid/__init__.py +0 -0
  49. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/raid/raid.py +0 -0
  50. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/vinum/__init__.py +0 -0
  51. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/vinum/c_vinum.py +0 -0
  52. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/vinum/config.py +0 -0
  53. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/vinum/vinum.py +0 -0
  54. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect/volume/vss.py +0 -0
  55. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect.volume.egg-info/dependency_links.txt +0 -0
  56. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect.volume.egg-info/requires.txt +0 -0
  57. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/dissect.volume.egg-info/top_level.txt +0 -0
  58. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/setup.cfg +0 -0
  59. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/__init__.py +0 -0
  60. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid0-1.bin.gz +0 -0
  61. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid0-2.bin.gz +0 -0
  62. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid0-3.bin.gz +0 -0
  63. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid0-raid1-1.bin.gz +0 -0
  64. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid0-raid1-2.bin.gz +0 -0
  65. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid1-1.bin.gz +0 -0
  66. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid1-2.bin.gz +0 -0
  67. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid10-1.bin.gz +0 -0
  68. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid10-2.bin.gz +0 -0
  69. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid10-3.bin.gz +0 -0
  70. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid10-4.bin.gz +0 -0
  71. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid4-1.bin.gz +0 -0
  72. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid4-2.bin.gz +0 -0
  73. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid5-1.bin.gz +0 -0
  74. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid5-2.bin.gz +0 -0
  75. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid5-3.bin.gz +0 -0
  76. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid6-1.bin.gz +0 -0
  77. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid6-2.bin.gz +0 -0
  78. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid6-3.bin.gz +0 -0
  79. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/ddf/ddf-raid6-4.bin.gz +0 -0
  80. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/apm.bin +0 -0
  81. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/bsd.bin +0 -0
  82. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/bsd64.bin.gz +0 -0
  83. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/gpt.bin +0 -0
  84. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/gpt_4k.bin +0 -0
  85. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/gpt_esxi.bin +0 -0
  86. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/gpt_hybrid.bin +0 -0
  87. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/gpt_no_name_xff.bin +0 -0
  88. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/disk/mbr.bin +0 -0
  89. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/dm/dm-thin-data.bin.gz +0 -0
  90. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/dm/dm-thin-empty-data.bin.gz +0 -0
  91. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/dm/dm-thin-empty-metadata.bin.gz +0 -0
  92. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/dm/dm-thin-metadata.bin.gz +0 -0
  93. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/lvm/lvm-mirror-1.bin.gz +0 -0
  94. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/lvm/lvm-mirror-2.bin.gz +0 -0
  95. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/lvm/lvm-thin.bin.gz +0 -0
  96. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/lvm/lvm.bin.gz +0 -0
  97. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-90-1.bin.gz +0 -0
  98. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-90-2.bin.gz +0 -0
  99. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-90-raid1-1.bin.gz +0 -0
  100. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-90-raid1-2.bin.gz +0 -0
  101. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-linear-1.bin.gz +0 -0
  102. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-linear-2.bin.gz +0 -0
  103. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid0-1.bin.gz +0 -0
  104. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid0-2.bin.gz +0 -0
  105. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid0-3.bin.gz +0 -0
  106. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid1-1.bin.gz +0 -0
  107. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid1-2.bin.gz +0 -0
  108. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid10-1.bin.gz +0 -0
  109. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid10-2.bin.gz +0 -0
  110. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid4-1.bin.gz +0 -0
  111. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid4-2.bin.gz +0 -0
  112. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid4-3.bin.gz +0 -0
  113. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid5-1.bin.gz +0 -0
  114. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid5-2.bin.gz +0 -0
  115. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid5-3.bin.gz +0 -0
  116. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid6-1.bin.gz +0 -0
  117. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid6-2.bin.gz +0 -0
  118. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid6-3.bin.gz +0 -0
  119. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/md/md-raid6-4.bin.gz +0 -0
  120. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-concat_diska.bin.gz +0 -0
  121. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-concat_diskb.bin.gz +0 -0
  122. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-mirror_diska.bin.gz +0 -0
  123. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-mirror_diskb.bin.gz +0 -0
  124. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-raid5_diska.bin.gz +0 -0
  125. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-raid5_diskb.bin.gz +0 -0
  126. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-raid5_diskc.bin.gz +0 -0
  127. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-raid5_diskd.bin.gz +0 -0
  128. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-striped_diska.bin.gz +0 -0
  129. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-striped_diskb.bin.gz +0 -0
  130. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-stripedmirror_diska.bin.gz +0 -0
  131. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-stripedmirror_diskb.bin.gz +0 -0
  132. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-stripedmirror_diskc.bin.gz +0 -0
  133. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_data/vinum/vinum-stripedmirror_diskd.bin.gz +0 -0
  134. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_docs/Makefile +0 -0
  135. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_docs/__init__.py +0 -0
  136. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_docs/conf.py +0 -0
  137. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/_docs/index.rst +0 -0
  138. {dissect_volume-3.16.dev1 → dissect_volume-3.17.dev2}/tests/conftest.py +0 -0
  139. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/ddf}/test_ddf.py +0 -0
  140. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/disk}/test_apm.py +0 -0
  141. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/disk}/test_mbr.py +0 -0
  142. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/dm}/test_dm.py +0 -0
  143. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/lvm}/test_lvm.py +0 -0
  144. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/md}/test_md.py +0 -0
  145. {dissect_volume-3.16.dev1/tests → dissect_volume-3.17.dev2/tests/vinum}/test_vinum.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.volume
3
- Version: 3.16.dev1
3
+ Version: 3.17.dev2
4
4
  Summary: A Dissect module implementing a parser for different disk volume and partition systems, for example LVM2, GPT and MBR
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
- License: Affero General Public License v3
6
+ License-Expression: AGPL-3.0-or-later
7
7
  Project-URL: homepage, https://dissect.tools
8
8
  Project-URL: documentation, https://docs.dissect.tools/en/latest/projects/dissect.volume
9
9
  Project-URL: repository, https://github.com/fox-it/dissect.volume
@@ -11,14 +11,13 @@ Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Information Technology
14
- Classifier: License :: OSI Approved
15
14
  Classifier: Operating System :: OS Independent
16
15
  Classifier: Programming Language :: Python :: 3
17
16
  Classifier: Topic :: Internet :: Log Analysis
18
17
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
19
18
  Classifier: Topic :: Security
20
19
  Classifier: Topic :: Utilities
21
- Requires-Python: ~=3.9
20
+ Requires-Python: >=3.10
22
21
  Description-Content-Type: text/markdown
23
22
  License-File: LICENSE
24
23
  License-File: COPYRIGHT
@@ -61,7 +61,7 @@ class DDFConfiguration(Configuration):
61
61
  sec = 0 if vdcr.secondary_element_count == 1 else vdcr.secondary_element_seq
62
62
 
63
63
  i = 0
64
- for starting_block, pds in zip(vdcr.starting_block, vdcr.physical_disk_sequence):
64
+ for starting_block, pds in zip(vdcr.starting_block, vdcr.physical_disk_sequence, strict=False):
65
65
  if matched_pd := pd_map.get(pds):
66
66
  vd_pd_map[sec * count + i] = (starting_block, matched_pd)
67
67
 
@@ -13,7 +13,7 @@ class Disk:
13
13
  def __init__(self, fh: BinaryIO, sector_size: int = 512):
14
14
  self.fh = fh
15
15
  self.sector_size = sector_size
16
- self.scheme = None
16
+ self.scheme: APM | GPT | MBR | BSD = None
17
17
  self.partitions: list[Partition] = []
18
18
 
19
19
  start = fh.tell()
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import TYPE_CHECKING, Any, BinaryIO
3
+ from typing import TYPE_CHECKING, BinaryIO
4
4
  from uuid import UUID
5
5
 
6
6
  from dissect.util.stream import RangeStream
@@ -8,6 +8,9 @@ from dissect.util.stream import RangeStream
8
8
  if TYPE_CHECKING:
9
9
  from dissect.cstruct import Structure
10
10
 
11
+ from dissect.volume.disk.schemes import APM, BSD, GPT, MBR
12
+
13
+
11
14
  PARTITION_TYPES = {
12
15
  0x00: "Empty",
13
16
  0x01: "FAT12,CHS",
@@ -178,47 +181,64 @@ PARTITION_TYPES = {
178
181
 
179
182
 
180
183
  class Partition:
184
+ """A partition on a disk.
185
+
186
+ Args:
187
+ disk: The disk the partition is on.
188
+ number: The partition number (1-indexed).
189
+ offset: The offset of the partition in bytes.
190
+ size: The size of the partition in bytes.
191
+ type: The partition type. This is either an integer (MBR, BSD), a string (APM),
192
+ or a UUID object (GPT).
193
+ name: The partition name (if available).
194
+ flags: The partition flags (if available).
195
+ guid: The partition GUID (if available).
196
+ type_str: The partition type as a string (if available).
197
+ raw: The raw partition structure (if available).
198
+ """
199
+
181
200
  def __init__(
182
201
  self,
183
- disk: Any,
202
+ disk: APM | BSD | GPT | MBR,
184
203
  number: int,
185
204
  offset: int,
186
205
  size: int,
187
- vtype: int | UUID,
188
- name: str,
206
+ type: int | str | UUID,
207
+ name: str | None = None,
189
208
  flags: int | None = None,
190
209
  guid: UUID | None = None,
191
- vtype_str: str | None = None,
210
+ type_str: str | None = None,
192
211
  raw: Structure = None,
193
212
  ):
194
213
  self.disk = disk
195
214
  self.number = number
196
215
  self.offset = offset
197
216
  self.size = size
198
- self.type = vtype
217
+ self.type = type
199
218
  self.name = name
200
219
  self.flags = flags
201
220
  self.guid = guid
202
- self.type_str = vtype_str
221
+ self.type_str = type_str
203
222
  self.raw = raw
204
223
 
205
224
  def __repr__(self) -> str:
206
- vtype_str = self.type_str
225
+ type_str = self.type_str
207
226
 
208
227
  if isinstance(self.type, int):
209
- vtype = hex(self.type)
210
- vtype_key = self.type
228
+ type = hex(self.type)
229
+ type_key = self.type
211
230
  elif isinstance(self.type, bytes):
212
- vtype = UUID(bytes_le=self.type)
213
- vtype_key = vtype
231
+ type = UUID(bytes_le=self.type)
232
+ type_key = type
214
233
  elif isinstance(self.type, str):
215
- vtype_str = self.type
234
+ type_str = self.type
216
235
 
217
- vtype_str = vtype_str or f"{vtype} ({PARTITION_TYPES.get(vtype_key, 'Unknown')})"
236
+ type_str = type_str or f"{type} ({PARTITION_TYPES.get(type_key, 'Unknown')})"
218
237
  return (
219
238
  f"<Partition number={self.number} offset=0x{self.offset:x} "
220
- f"size=0x{self.size:x} type={vtype_str} name={self.name!r}>"
239
+ f"size=0x{self.size:x} type={type_str} name={self.name!r}>"
221
240
  )
222
241
 
223
242
  def open(self) -> BinaryIO:
243
+ """Open a stream to the partition."""
224
244
  return RangeStream(self.disk.fh, offset=self.offset, size=self.size)
@@ -66,7 +66,7 @@ class APM:
66
66
  number=i + 1, # partitions are 1-indexed
67
67
  offset=p.partition_start * self.sector_size,
68
68
  size=p.partition_size * self.sector_size,
69
- vtype=p.partition_type.rstrip(b"\x00").decode(),
69
+ type=p.partition_type.rstrip(b"\x00").decode(),
70
70
  name=p.partition_name.rstrip(b"\x00").decode(),
71
71
  raw=p,
72
72
  )
@@ -284,11 +284,11 @@ class BSD:
284
284
  # MBR DragonFlyBSD
285
285
  0x6C,
286
286
  # GPT DragonFlyBSD disklabel32
287
- UUID("9D087404-1CA5-11DC-8817-01301BB8A9F5").bytes_le,
287
+ UUID("9D087404-1CA5-11DC-8817-01301BB8A9F5"),
288
288
  # GPT DragonFlyBSD disklabel64
289
- UUID("3D48CE54-1D16-11DC-8696-01301BB8A9F5").bytes_le,
289
+ UUID("3D48CE54-1D16-11DC-8696-01301BB8A9F5"),
290
290
  # GPT FreeBSD disklabel
291
- UUID("516E7CB4-6ECF-11D6-8FF8-00022D09712B").bytes_le,
291
+ UUID("516E7CB4-6ECF-11D6-8FF8-00022D09712B"),
292
292
  )
293
293
 
294
294
  def __init__(self, fh: BinaryIO, sector_size: int = 512):
@@ -358,16 +358,15 @@ class BSD:
358
358
 
359
359
  offset = partition.p_boffset
360
360
  size = partition.p_bsize
361
- guid = partition.p_stor_uuid
361
+ guid = UUID(bytes_le=partition.p_stor_uuid)
362
362
 
363
363
  yield Partition(
364
364
  disk=self,
365
365
  number=i + 1, # partitions are 1-indexed
366
366
  offset=offset,
367
367
  size=size,
368
- vtype=partition.p_fstype,
369
- name=None,
368
+ type=partition.p_fstype,
370
369
  guid=guid,
371
- vtype_str=FS_NAMES.get(partition.p_fstype, "?"),
370
+ type_str=FS_NAMES.get(partition.p_fstype, "?"),
372
371
  raw=partition,
373
372
  )
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING, BinaryIO
4
+ from uuid import UUID
4
5
 
5
6
  from dissect.cstruct import cstruct
6
7
 
@@ -108,10 +109,10 @@ class GPT:
108
109
  number=part_num + 1, # partitions are 1-indexed
109
110
  offset=partition.first_lba * self.sector_size,
110
111
  size=(partition.last_lba - partition.first_lba) * self.sector_size,
111
- vtype=partition.type_guid,
112
+ type=UUID(bytes_le=partition.type_guid),
112
113
  name=name,
113
114
  flags=partition.attribute_flags,
114
- guid=partition.partition_guid,
115
+ guid=UUID(bytes_le=partition.partition_guid),
115
116
  raw=partition,
116
117
  )
117
118
 
@@ -83,8 +83,7 @@ class MBR:
83
83
  number=num_start + num + 1, # partitions are 1-indexed
84
84
  offset=part_offset,
85
85
  size=partition.sector_size * self.sector_size,
86
- vtype=partition.type,
87
- name=None,
86
+ type=partition.type,
88
87
  flags=partition.bootable,
89
88
  raw=partition,
90
89
  )
@@ -1,16 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
- import sys
4
3
  from dataclasses import dataclass
5
4
  from datetime import datetime # noqa: TC003
6
5
  from functools import cache
7
- from typing import BinaryIO, Optional, get_args, get_origin, get_type_hints
8
-
9
- if sys.version_info >= (3, 10):
10
- from types import UnionType # novermin
11
- else:
12
- # Python 3.9
13
- from typing import Union as UnionType
6
+ from types import UnionType
7
+ from typing import BinaryIO, get_args, get_origin, get_type_hints
14
8
 
15
9
  from dissect.util import ts
16
10
  from dissect.util.stream import MappingStream
@@ -36,7 +30,7 @@ class MetaBase:
36
30
 
37
31
  type_ = get_origin(field_type)
38
32
 
39
- if type_ is UnionType and field_type == Optional[field_type]:
33
+ if type_ is UnionType and field_type == field_type | None:
40
34
  value = obj.get(field_name)
41
35
  field_type = get_args(field_type)[0]
42
36
  type_ = get_origin(field_type)
@@ -586,14 +580,3 @@ class RAIDSegment(Segment):
586
580
 
587
581
  if self.raids:
588
582
  self.raids = [tuple(self.raids[i : i + 2]) for i in range(0, len(self.raids), 2)]
589
-
590
-
591
- # Backward compatibility with Python 3.9
592
- if sys.version_info < (3, 10):
593
- items = list(globals().values())
594
- for obj in items:
595
- if isinstance(obj, type) and issubclass(obj, MetaBase) and hasattr(obj, "__annotations__"):
596
- for k, v in obj.__annotations__.items():
597
- if isinstance(v, str) and "|" in v:
598
- # Because we import Union as UnionType
599
- obj.__annotations__[k] = f"UnionType[{v.replace(' | ', ', ')}]"
@@ -358,7 +358,7 @@ class RAID456Stream(AlignedStream):
358
358
 
359
359
  stripe_size = self.virtual_disk.stripe_size
360
360
  while length:
361
- stripe, offset_in_stripe, dd_idx, pd_idx, qd_idx, ddf_layout = self._get_stripe_read_info(offset)
361
+ stripe, offset_in_stripe, dd_idx, _, _, _ = self._get_stripe_read_info(offset)
362
362
  offset_in_device = stripe * stripe_size + offset_in_stripe
363
363
  dd_start, dd_dev = self.disk_map[dd_idx]
364
364
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.volume
3
- Version: 3.16.dev1
3
+ Version: 3.17.dev2
4
4
  Summary: A Dissect module implementing a parser for different disk volume and partition systems, for example LVM2, GPT and MBR
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
- License: Affero General Public License v3
6
+ License-Expression: AGPL-3.0-or-later
7
7
  Project-URL: homepage, https://dissect.tools
8
8
  Project-URL: documentation, https://docs.dissect.tools/en/latest/projects/dissect.volume
9
9
  Project-URL: repository, https://github.com/fox-it/dissect.volume
@@ -11,14 +11,13 @@ Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Information Technology
14
- Classifier: License :: OSI Approved
15
14
  Classifier: Operating System :: OS Independent
16
15
  Classifier: Programming Language :: Python :: 3
17
16
  Classifier: Topic :: Internet :: Log Analysis
18
17
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
19
18
  Classifier: Topic :: Security
20
19
  Classifier: Topic :: Utilities
21
- Requires-Python: ~=3.9
20
+ Requires-Python: >=3.10
22
21
  Description-Content-Type: text/markdown
23
22
  License-File: LICENSE
24
23
  License-File: COPYRIGHT
@@ -47,16 +47,6 @@ dissect/volume/vinum/config.py
47
47
  dissect/volume/vinum/vinum.py
48
48
  tests/__init__.py
49
49
  tests/conftest.py
50
- tests/test_apm.py
51
- tests/test_bsd.py
52
- tests/test_ddf.py
53
- tests/test_dm.py
54
- tests/test_gpt.py
55
- tests/test_lvm.py
56
- tests/test_mbr.py
57
- tests/test_md.py
58
- tests/test_vinum.py
59
- tests/test_vinum_config.py
60
50
  tests/_data/ddf/ddf-raid0-1.bin.gz
61
51
  tests/_data/ddf/ddf-raid0-2.bin.gz
62
52
  tests/_data/ddf/ddf-raid0-3.bin.gz
@@ -134,4 +124,20 @@ tests/_data/vinum/vinum-stripedmirror_diskd.bin.gz
134
124
  tests/_docs/Makefile
135
125
  tests/_docs/__init__.py
136
126
  tests/_docs/conf.py
137
- tests/_docs/index.rst
127
+ tests/_docs/index.rst
128
+ tests/ddf/__init__.py
129
+ tests/ddf/test_ddf.py
130
+ tests/disk/__init__.py
131
+ tests/disk/test_apm.py
132
+ tests/disk/test_bsd.py
133
+ tests/disk/test_gpt.py
134
+ tests/disk/test_mbr.py
135
+ tests/dm/__init__.py
136
+ tests/dm/test_dm.py
137
+ tests/lvm/__init__.py
138
+ tests/lvm/test_lvm.py
139
+ tests/md/__init__.py
140
+ tests/md/test_md.py
141
+ tests/vinum/__init__.py
142
+ tests/vinum/test_config.py
143
+ tests/vinum/test_vinum.py
@@ -1,13 +1,14 @@
1
1
  [build-system]
2
- requires = ["setuptools>=65.5.0", "setuptools_scm[toml]>=6.4.0"]
2
+ requires = ["setuptools>=77.0.0", "setuptools_scm[toml]>=6.4.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dissect.volume"
7
7
  description = "A Dissect module implementing a parser for different disk volume and partition systems, for example LVM2, GPT and MBR"
8
8
  readme = "README.md"
9
- requires-python = "~=3.9"
10
- license.text = "Affero General Public License v3"
9
+ requires-python = ">=3.10"
10
+ license = "AGPL-3.0-or-later"
11
+ license-files = ["LICENSE", "COPYRIGHT"]
11
12
  authors = [
12
13
  {name = "Dissect Team", email = "dissect@fox-it.com"}
13
14
  ]
@@ -16,7 +17,6 @@ classifiers = [
16
17
  "Environment :: Console",
17
18
  "Intended Audience :: Developers",
18
19
  "Intended Audience :: Information Technology",
19
- "License :: OSI Approved",
20
20
  "Operating System :: OS Independent",
21
21
  "Programming Language :: Python :: 3",
22
22
  "Topic :: Internet :: Log Analysis",
@@ -41,9 +41,29 @@ dev = [
41
41
  "dissect.util>=3.0.dev,<4.0.dev",
42
42
  ]
43
43
 
44
+ [dependency-groups]
45
+ test = [
46
+ "pytest",
47
+ ]
48
+ lint = [
49
+ "ruff==0.13.1",
50
+ "vermin",
51
+ ]
52
+ build = [
53
+ "build",
54
+ ]
55
+ debug = [
56
+ "ipdb",
57
+ ]
58
+ dev = [
59
+ {include-group = "test"},
60
+ {include-group = "lint"},
61
+ {include-group = "debug"},
62
+ ]
63
+
44
64
  [tool.ruff]
45
65
  line-length = 120
46
- required-version = ">=0.9.0"
66
+ required-version = ">=0.13.1"
47
67
 
48
68
  [tool.ruff.format]
49
69
  docstring-code-format = true
@@ -92,9 +112,6 @@ ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM1
92
112
  known-first-party = ["dissect.volume"]
93
113
  known-third-party = ["dissect"]
94
114
 
95
- [tool.setuptools]
96
- license-files = ["LICENSE", "COPYRIGHT"]
97
-
98
115
  [tool.setuptools.packages.find]
99
116
  include = ["dissect.*"]
100
117
 
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from typing import BinaryIO
4
+ from uuid import UUID
4
5
 
5
6
  from dissect.volume import disk
6
7
  from dissect.volume.disk.schemes import BSD
@@ -15,18 +16,21 @@ def test_bsd(bsd: BinaryIO) -> None:
15
16
  assert vs.partitions[0].offset == 0x800
16
17
  assert vs.partitions[0].size == 0x200
17
18
  assert vs.partitions[0].type == 7
19
+ assert vs.partitions[0].guid is None
18
20
  assert vs.partitions[0].open().read() == b"\x01" * 512
19
21
 
20
22
  assert vs.partitions[1].number == 2
21
23
  assert vs.partitions[1].offset == 0xC00
22
24
  assert vs.partitions[1].size == 0x200
23
25
  assert vs.partitions[1].type == 1
26
+ assert vs.partitions[1].guid is None
24
27
  assert vs.partitions[1].open().read() == b"\x02" * 512
25
28
 
26
29
  assert vs.partitions[2].number == 5
27
30
  assert vs.partitions[2].offset == 0x1000
28
31
  assert vs.partitions[2].size == 0x200
29
32
  assert vs.partitions[2].type == 27
33
+ assert vs.partitions[2].guid is None
30
34
  assert vs.partitions[2].open().read() == b"\x05" * 512
31
35
 
32
36
 
@@ -42,16 +46,19 @@ def test_bsd64(bsd64: BinaryIO) -> None:
42
46
  assert d.partitions[1].offset == 0x100000
43
47
  assert d.partitions[1].size == 0x1000
44
48
  assert d.partitions[1].type == 7
49
+ assert d.partitions[1].guid == UUID("c3ce50a4-61bd-11ed-9048-010c29feac9a")
45
50
  assert d.partitions[1].open().read(512) == b"\x01" * 512
46
51
 
47
52
  assert d.partitions[2].number == 2
48
53
  assert d.partitions[2].offset == 0x101000
49
54
  assert d.partitions[2].size == 0x1000
50
55
  assert d.partitions[2].type == 7
56
+ assert d.partitions[2].guid == UUID("eebaf645-61bd-11ed-9048-010c29feac9a")
51
57
  assert d.partitions[2].open().read(512) == b"\x02" * 512
52
58
 
53
59
  assert d.partitions[3].number == 5
54
60
  assert d.partitions[3].offset == 0x102000
55
61
  assert d.partitions[3].size == 0x1000
56
62
  assert d.partitions[3].type == 7
63
+ assert d.partitions[3].guid == UUID("eebaf650-61bd-11ed-9048-010c29feac9a")
57
64
  assert d.partitions[3].open().read(512) == b"\x05" * 512
@@ -1,7 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import io
4
+ import re
4
5
  from typing import BinaryIO
6
+ from uuid import UUID
5
7
 
6
8
  import pytest
7
9
 
@@ -20,13 +22,15 @@ def test_gpt(gpt: BinaryIO) -> None:
20
22
  assert d.partitions[0].number == 1
21
23
  assert d.partitions[0].offset == 20480
22
24
  assert d.partitions[0].size == 0xC7FFE00
23
- assert d.partitions[0].type == b"\x28\x73\x2a\xc1\x1f\xf8\xd2\x11\xba\x4b\x00\xa0\xc9\x3e\xc9\x3b"
25
+ assert d.partitions[0].type == UUID("c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
26
+ assert d.partitions[0].guid == UUID("27d920bc-e414-45e0-9503-2606de7a1056")
24
27
  assert d.partitions[0].name == "EFI System Partition"
25
28
 
26
29
  assert d.partitions[1].number == 2
27
30
  assert d.partitions[1].offset == 0xC900000
28
31
  assert d.partitions[1].size == 0x7465FFE00
29
- assert d.partitions[1].type == b"\xa2\xa0\xd0\xeb\xe5\xb9\x33\x44\x87\xc0\x68\xb6\xb7\x26\x99\xc7"
32
+ assert d.partitions[1].type == UUID("ebd0a0a2-b9e5-4433-87c0-68b6b72699c7")
33
+ assert d.partitions[1].guid == UUID("a14cecf3-b364-4d6d-a540-e245e6df9d11")
30
34
  assert d.partitions[1].name == ""
31
35
 
32
36
 
@@ -48,39 +52,44 @@ def test_hybrid_gpt(gpt_hybrid: BinaryIO) -> None:
48
52
  assert d.partitions[0].offset == 0x100000
49
53
  assert d.partitions[0].size == 0x80200
50
54
  assert d.partitions[0].type == 0x83
55
+ assert d.partitions[0].guid is None
51
56
  assert d.partitions[0].name is None
52
57
 
53
58
  assert d.partitions[1].number == 2
54
59
  assert d.partitions[1].offset == 0x180200
55
60
  assert d.partitions[1].size == 0x7BC00
56
61
  assert d.partitions[1].type == 0x83
62
+ assert d.partitions[1].guid is None
57
63
  assert d.partitions[1].name is None
58
64
 
59
65
  assert d.partitions[2].number == 1
60
66
  assert d.partitions[2].offset == 0x100000
61
67
  assert d.partitions[2].size == 0x80000
62
- assert d.partitions[2].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
68
+ assert d.partitions[2].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
69
+ assert d.partitions[2].guid == UUID("44eea528-8489-4bbc-a480-56bd208cd233")
63
70
  assert d.partitions[2].name == "Linux filesystem"
64
71
 
65
72
  assert d.partitions[3].number == 2
66
73
  assert d.partitions[3].offset == 0x4400
67
74
  assert d.partitions[3].size == 0xFBA00
68
- assert d.partitions[3].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
75
+ assert d.partitions[3].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
76
+ assert d.partitions[3].guid == UUID("8f4bcd34-d9d4-4060-a683-6f75c90b795b")
69
77
  assert d.partitions[3].name == "Linux filesystem"
70
78
 
71
79
  assert d.partitions[4].number == 3
72
80
  assert d.partitions[4].offset == 0x180200
73
81
  assert d.partitions[4].size == 0x7BA00
74
- assert d.partitions[4].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
82
+ assert d.partitions[4].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
83
+ assert d.partitions[4].guid == UUID("b6aa0017-3abb-4c2b-b00c-5189e66d9896")
75
84
  assert d.partitions[4].name == "Linux filesystem"
76
85
 
77
86
 
78
87
  def test_gpt_4k(gpt_4k: BinaryIO) -> None:
79
- with pytest.raises(disk.DiskError) as e:
88
+ with pytest.raises(
89
+ disk.DiskError, match=re.escape("Found GPT type partition, but MBR scheme detected. Maybe 4K sector size.")
90
+ ):
80
91
  disk.Disk(gpt_4k)
81
92
 
82
- assert str(e.value) == "Found GPT type partition, but MBR scheme detected. Maybe 4K sector size."
83
-
84
93
  gpt_4k.seek(0)
85
94
  d = disk.Disk(gpt_4k, sector_size=4096)
86
95
 
@@ -90,19 +99,22 @@ def test_gpt_4k(gpt_4k: BinaryIO) -> None:
90
99
  assert d.partitions[0].number == 1
91
100
  assert d.partitions[0].offset == 0x100000
92
101
  assert d.partitions[0].size == 0x100000
93
- assert d.partitions[0].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
102
+ assert d.partitions[0].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
103
+ assert d.partitions[0].guid == UUID("21b90a6e-0918-4e72-aa1a-85f8ba8ef8cc")
94
104
  assert d.partitions[0].name == "Linux filesystem"
95
105
 
96
106
  assert d.partitions[1].number == 2
97
107
  assert d.partitions[1].offset == 0x300000
98
108
  assert d.partitions[1].size == 0x100000
99
- assert d.partitions[1].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
109
+ assert d.partitions[1].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
110
+ assert d.partitions[1].guid == UUID("c6f4ad42-4652-448d-89d7-7cfa7710abe7")
100
111
  assert d.partitions[1].name == "Linux filesystem"
101
112
 
102
113
  assert d.partitions[2].number == 3
103
114
  assert d.partitions[2].offset == 0x500000
104
115
  assert d.partitions[2].size == 0xB5A000
105
- assert d.partitions[2].type == b"\xaf\x3d\xc6\x0f\x83\x84\x72\x47\x8e\x79\x3d\x69\xd8\x47\x7d\xe4"
116
+ assert d.partitions[2].type == UUID("0fc63daf-8483-4772-8e79-3d69d8477de4")
117
+ assert d.partitions[2].guid == UUID("b7230707-dcaa-4483-823b-06f9b718ee55")
106
118
  assert d.partitions[2].name == "Linux filesystem"
107
119
 
108
120
 
@@ -115,31 +127,36 @@ def test_gpt_esxi(gpt_esxi: BinaryIO) -> None:
115
127
  assert d.partitions[0].number == 1
116
128
  assert d.partitions[0].offset == 0x8000
117
129
  assert d.partitions[0].size == 0x63FFE00
118
- assert d.partitions[0].type == b"\x28\x73\x2a\xc1\x1f\xf8\xd2\x11\xba\x4b\x00\xa0\xc9\x3e\xc9\x3b"
130
+ assert d.partitions[0].type == UUID("c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
131
+ assert d.partitions[0].guid == UUID("0f7a6017-09ed-474c-b4b2-b377059d593a")
119
132
  assert d.partitions[0].name == "BOOT"
120
133
 
121
134
  assert d.partitions[1].number == 5
122
135
  assert d.partitions[1].offset == 0x6600000
123
136
  assert d.partitions[1].size == 0xFFEFFE00
124
- assert d.partitions[1].type == b"\xa2\xa0\xd0\xeb\xe5\xb9\x33\x44\x87\xc0\x68\xb6\xb7\x26\x99\xc7"
137
+ assert d.partitions[1].type == UUID("ebd0a0a2-b9e5-4433-87c0-68b6b72699c7")
138
+ assert d.partitions[1].guid == UUID("cc02273b-7b9b-4075-9e93-b1755f07dca5")
125
139
  assert d.partitions[1].name == "BOOTBANK1"
126
140
 
127
141
  assert d.partitions[2].number == 6
128
142
  assert d.partitions[2].offset == 0x106600000
129
143
  assert d.partitions[2].size == 0xFFEFFE00
130
- assert d.partitions[2].type == b"\xa2\xa0\xd0\xeb\xe5\xb9\x33\x44\x87\xc0\x68\xb6\xb7\x26\x99\xc7"
144
+ assert d.partitions[2].type == UUID("ebd0a0a2-b9e5-4433-87c0-68b6b72699c7")
145
+ assert d.partitions[2].guid == UUID("ec9f58a6-4b6c-45f8-a703-f212e8c28a0a")
131
146
  assert d.partitions[2].name == "BOOTBANK2"
132
147
 
133
148
  assert d.partitions[3].number == 7
134
149
  assert d.partitions[3].offset == 0x206600000
135
150
  assert d.partitions[3].size == 0x1DF99FFE00
136
- assert d.partitions[3].type == b"\x39\xea\xb2\x4e\x55\x78\x90\x47\xa7\x9e\xfa\xe4\x95\xe2\x1f\x8d"
151
+ assert d.partitions[3].type == UUID("4eb2ea39-7855-4790-a79e-fae495e21f8d")
152
+ assert d.partitions[3].guid == UUID("fc7f0906-62a5-47b2-8f40-98d9427fefe0")
137
153
  assert d.partitions[3].name == "OSDATA"
138
154
 
139
155
  assert d.partitions[4].number == 8
140
156
  assert d.partitions[4].offset == 0x2000100000
141
157
  assert d.partitions[4].size == 0x37FEFBC00
142
- assert d.partitions[4].type == b"\x2a\xe0\x31\xaa\x0f\x40\xdb\x11\x95\x90\x00\x0c\x29\x11\xd1\xb8"
158
+ assert d.partitions[4].type == UUID("aa31e02a-400f-11db-9590-000c2911d1b8")
159
+ assert d.partitions[4].guid == UUID("327aa3da-0d50-4e97-b28f-014d92724aab")
143
160
  assert d.partitions[4].name == "datastore1"
144
161
 
145
162
 
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
- from datetime import datetime
4
+ from datetime import datetime, timezone
5
5
  from typing import TYPE_CHECKING
6
6
  from unittest.mock import patch
7
7
 
@@ -30,7 +30,7 @@ from dissect.volume.vinum.config import (
30
30
  if TYPE_CHECKING:
31
31
  from collections.abc import Iterator
32
32
 
33
- CONF_TS = datetime.min
33
+ CONF_TS = datetime.min.replace(tzinfo=timezone.utc)
34
34
 
35
35
 
36
36
  def test_volume_state() -> None:
@@ -4,7 +4,7 @@ envlist = lint, py3, pypy3
4
4
  # requires if they are not available on the host system. This requires the
5
5
  # locally installed tox to have a minimum version 3.3.0. This means the names
6
6
  # of the configuration options are still according to the tox 3.x syntax.
7
- minversion = 4.4.3
7
+ minversion = 4.27.0
8
8
  # This version of virtualenv will install setuptools version 68.2.2 and pip
9
9
  # 23.3.1. These versions fully support python projects defined only through a
10
10
  # pyproject.toml file (PEP-517/PEP-518/PEP-621). This pip version also support
@@ -14,9 +14,9 @@ requires = virtualenv>=20.24.6
14
14
  [testenv]
15
15
  extras = dev
16
16
  deps =
17
- pytest
18
17
  pytest-cov
19
18
  coverage
19
+ dependency_groups = test
20
20
  commands =
21
21
  pytest --basetemp="{envtmpdir}" {posargs:--color=yes --cov=dissect --cov-report=term-missing -v tests}
22
22
  coverage report
@@ -24,26 +24,24 @@ commands =
24
24
 
25
25
  [testenv:build]
26
26
  package = skip
27
- deps =
28
- build
27
+ dependency_groups = build
29
28
  commands =
30
29
  pyproject-build
31
30
 
32
31
  [testenv:fix]
33
32
  package = skip
34
- deps =
35
- ruff==0.9.2
33
+ dependency_groups = lint
36
34
  commands =
35
+ ruff check --fix dissect tests
37
36
  ruff format dissect tests
38
37
 
39
38
  [testenv:lint]
40
39
  package = skip
41
- deps =
42
- ruff==0.9.2
43
- vermin
40
+ dependency_groups = lint
44
41
  commands =
45
42
  ruff check dissect tests
46
- vermin -t=3.9- --no-tips --lint dissect tests
43
+ ruff format --check dissect tests
44
+ vermin -t=3.10- --no-tips --lint dissect tests
47
45
 
48
46
  [testenv:docs-build]
49
47
  allowlist_externals = make