dissect.hypervisor 3.21.dev3__tar.gz → 3.21.dev4__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 (105) hide show
  1. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/PKG-INFO +1 -1
  2. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/vmdk.py +4 -2
  3. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/PKG-INFO +1 -1
  4. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_vmdk.py +40 -1
  5. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/.git-blame-ignore-revs +0 -0
  6. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/COPYRIGHT +0 -0
  7. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/LICENSE +0 -0
  8. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/MANIFEST.in +0 -0
  9. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/README.md +0 -0
  10. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/__init__.py +0 -0
  11. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/__init__.py +0 -0
  12. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/c_hyperv.py +0 -0
  13. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/hyperv.py +0 -0
  14. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/ovf.py +0 -0
  15. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/pvs.py +0 -0
  16. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/vbox.py +0 -0
  17. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/descriptor/vmx.py +0 -0
  18. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/__init__.py +0 -0
  19. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/asif.py +0 -0
  20. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_asif.py +0 -0
  21. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_asif.pyi +0 -0
  22. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_hdd.py +0 -0
  23. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_qcow2.py +0 -0
  24. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_qcow2.pyi +0 -0
  25. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_vdi.py +0 -0
  26. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_vhd.py +0 -0
  27. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_vhdx.py +0 -0
  28. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/c_vmdk.py +0 -0
  29. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/hdd.py +0 -0
  30. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/qcow2.py +0 -0
  31. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/vdi.py +0 -0
  32. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/vhd.py +0 -0
  33. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/disk/vhdx.py +0 -0
  34. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/exceptions.py +0 -0
  35. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/tools/__init__.py +0 -0
  36. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/tools/envelope.py +0 -0
  37. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/tools/vmtar.py +0 -0
  38. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/util/__init__.py +0 -0
  39. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/util/envelope.py +0 -0
  40. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect/hypervisor/util/vmtar.py +0 -0
  41. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/SOURCES.txt +0 -0
  42. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/dependency_links.txt +0 -0
  43. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/entry_points.txt +0 -0
  44. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/requires.txt +0 -0
  45. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/dissect.hypervisor.egg-info/top_level.txt +0 -0
  46. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/pyproject.toml +0 -0
  47. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/setup.cfg +0 -0
  48. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/__init__.py +0 -0
  49. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/descriptor/hyperv/test.VMRS +0 -0
  50. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/descriptor/hyperv/test.vmcx +0 -0
  51. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/descriptor/vbox/GOAD-DC01.vbox +0 -0
  52. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/descriptor/vbox/encrypted.vbox +0 -0
  53. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/descriptor/vmx/encrypted.vmx +0 -0
  54. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/asif/basic.asif.gz +0 -0
  55. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/expanding.hdd/DiskDescriptor.xml +0 -0
  56. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/expanding.hdd/expanding.hdd +0 -0
  57. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/expanding.hdd/expanding.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  58. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/plain.hdd/DiskDescriptor.xml +0 -0
  59. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/plain.hdd/plain.hdd +0 -0
  60. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/plain.hdd/plain.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  61. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/DiskDescriptor.xml +0 -0
  62. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd +0 -0
  63. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  64. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.1.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  65. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.2.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  66. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.3.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  67. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.4.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  68. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/hdd/split.hdd/split.hdd.5.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  69. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/backing-chain-1.qcow2.gz +0 -0
  70. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/backing-chain-2.qcow2.gz +0 -0
  71. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/backing-chain-3.qcow2.gz +0 -0
  72. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/basic-zstd.qcow2.gz +0 -0
  73. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/basic.qcow2.gz +0 -0
  74. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/data-file.bin.gz +0 -0
  75. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/data-file.qcow2.gz +0 -0
  76. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/qcow2/snapshot.qcow2.gz +0 -0
  77. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vhd/dynamic.vhd.gz +0 -0
  78. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vhd/fixed.vhd.gz +0 -0
  79. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vhdx/differencing.avhdx.gz +0 -0
  80. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vhdx/dynamic.vhdx.gz +0 -0
  81. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vhdx/fixed.vhdx.gz +0 -0
  82. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/disk/vmdk/sesparse.vmdk.gz +0 -0
  83. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/util/envelope/encryption.info +0 -0
  84. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/util/envelope/local.tgz.ve +0 -0
  85. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_data/util/vmtar/test.vgz +0 -0
  86. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_docs/Makefile +0 -0
  87. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_docs/conf.py +0 -0
  88. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_docs/index.rst +0 -0
  89. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/_util.py +0 -0
  90. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/__init__.py +0 -0
  91. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/test_hyperv.py +0 -0
  92. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/test_ovf.py +0 -0
  93. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/test_pvs.py +0 -0
  94. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/test_vbox.py +0 -0
  95. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/descriptor/test_vmx.py +0 -0
  96. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/__init__.py +0 -0
  97. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_asif.py +0 -0
  98. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_hdd.py +0 -0
  99. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_qcow2.py +0 -0
  100. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_vhd.py +0 -0
  101. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/disk/test_vhdx.py +0 -0
  102. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/util/__init__.py +0 -0
  103. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/util/test_envelope.py +0 -0
  104. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tests/util/test_vmtar.py +0 -0
  105. {dissect_hypervisor-3.21.dev3 → dissect_hypervisor-3.21.dev4}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.21.dev3
3
+ Version: 3.21.dev4
4
4
  Summary: A Dissect module implementing parsers for various hypervisor disk, backup and configuration files
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -535,8 +535,10 @@ def open_parent(path: Path, filename_hint: str) -> VMDK:
535
535
  hint_path, _, filename = filename_hint.rpartition("/")
536
536
  filepath = path.joinpath(filename)
537
537
  if not filepath.exists():
538
- _, _, hint_path_name = hint_path.rpartition("/")
539
- filepath = path.parent.joinpath(hint_path_name).joinpath(filename)
538
+ filepath = path.joinpath(filename_hint)
539
+ if not filepath.exists():
540
+ _, _, hint_path_name = hint_path.rpartition("/")
541
+ filepath = path.parent.joinpath(hint_path_name).joinpath(filename)
540
542
  vmdk = VMDK(filepath)
541
543
  except Exception as err:
542
544
  raise IOError(f"Failed to open parent disk with hint {filename_hint} from path {path}: {err}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.21.dev3
3
+ Version: 3.21.dev4
4
4
  Summary: A Dissect module implementing parsers for various hypervisor disk, backup and configuration files
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -1,11 +1,13 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import gzip
4
+ from pathlib import Path
5
+ from unittest.mock import MagicMock
4
6
 
5
7
  import pytest
6
8
 
7
9
  from dissect.hypervisor.disk.c_vmdk import c_vmdk
8
- from dissect.hypervisor.disk.vmdk import VMDK, DiskDescriptor, ExtentDescriptor
10
+ from dissect.hypervisor.disk.vmdk import VMDK, DiskDescriptor, ExtentDescriptor, open_parent
9
11
  from tests._util import absolute_path
10
12
 
11
13
 
@@ -203,3 +205,40 @@ def test_vmdk_extent_description(extent_description: str, expected_extents: list
203
205
 
204
206
  descriptor = DiskDescriptor.parse(extent_description)
205
207
  assert descriptor.extents == expected_extents
208
+
209
+
210
+ def test_open_parent_all_cases(monkeypatch: pytest.MonkeyPatch) -> None:
211
+ """Test open_parent handles absolute and relative filename_hint paths."""
212
+
213
+ # Mock Path.exists to simulate file existence
214
+ def mock_exists(path: Path) -> bool:
215
+ return str(path) in {
216
+ "/a/b/c/d.vmdk", # Case: absolute path
217
+ "base/relative/hint.vmdk", # Case: full relative path
218
+ "base/hint.vmdk", # Case: basename in same dir
219
+ "../sibling/hint.vmdk", # Case: fallback to sibling
220
+ }
221
+
222
+ with monkeypatch.context() as m:
223
+ m.setattr("pathlib.Path.exists", mock_exists)
224
+
225
+ # Mock VMDK to avoid real file I/O
226
+ mock_vmdk = MagicMock()
227
+ m.setattr("dissect.hypervisor.disk.vmdk.VMDK", lambda path: mock_vmdk)
228
+ mock_vmdk.path = "mocked-path"
229
+
230
+ # Case: Absolute path — should use /a/b/c/d.vmdk directly
231
+ vmdk = open_parent(Path("base"), "/a/b/c/d.vmdk")
232
+ assert str(vmdk.path) == "mocked-path"
233
+
234
+ # Case: Full relative path — try base/relative/hint.vmdk
235
+ vmdk = open_parent(Path("base"), "relative/hint.vmdk")
236
+ assert str(vmdk.path) == "mocked-path"
237
+
238
+ # Case: Basename only — fall back to base/hint.vmdk
239
+ vmdk = open_parent(Path("base"), "hint.vmdk")
240
+ assert str(vmdk.path) == "mocked-path"
241
+
242
+ # Case: Fallback to sibling — try ../sibling/hint.vmdk
243
+ vmdk = open_parent(Path("base"), "sibling/hint.vmdk")
244
+ assert str(vmdk.path) == "mocked-path"