dissect.hypervisor 3.21.dev5__tar.gz → 3.22.dev1__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 (71) hide show
  1. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/PKG-INFO +1 -1
  2. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/qcow2.py +2 -2
  3. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/PKG-INFO +1 -1
  4. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_qcow2.py +18 -0
  5. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/.git-blame-ignore-revs +0 -0
  6. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/COPYRIGHT +0 -0
  7. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/LICENSE +0 -0
  8. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/MANIFEST.in +0 -0
  9. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/README.md +0 -0
  10. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/__init__.py +0 -0
  11. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/__init__.py +0 -0
  12. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/c_hyperv.py +0 -0
  13. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/hyperv.py +0 -0
  14. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/ovf.py +0 -0
  15. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/pvs.py +0 -0
  16. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/vbox.py +0 -0
  17. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/descriptor/vmx.py +0 -0
  18. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/__init__.py +0 -0
  19. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/asif.py +0 -0
  20. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_asif.py +0 -0
  21. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_asif.pyi +0 -0
  22. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_hdd.py +0 -0
  23. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_qcow2.py +0 -0
  24. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_qcow2.pyi +0 -0
  25. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_vdi.py +0 -0
  26. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_vdi.pyi +0 -0
  27. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_vhd.py +0 -0
  28. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_vhdx.py +0 -0
  29. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/c_vmdk.py +0 -0
  30. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/hdd.py +0 -0
  31. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/vdi.py +0 -0
  32. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/vhd.py +0 -0
  33. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/vhdx.py +0 -0
  34. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/disk/vmdk.py +0 -0
  35. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/exceptions.py +0 -0
  36. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/tools/__init__.py +0 -0
  37. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/tools/envelope.py +0 -0
  38. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/tools/vmtar.py +0 -0
  39. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/util/__init__.py +0 -0
  40. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/util/envelope.py +0 -0
  41. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect/hypervisor/util/vmtar.py +0 -0
  42. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/SOURCES.txt +0 -0
  43. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/dependency_links.txt +0 -0
  44. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/entry_points.txt +0 -0
  45. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/requires.txt +0 -0
  46. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/dissect.hypervisor.egg-info/top_level.txt +0 -0
  47. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/pyproject.toml +0 -0
  48. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/setup.cfg +0 -0
  49. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/__init__.py +0 -0
  50. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/_docs/Makefile +0 -0
  51. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/_docs/conf.py +0 -0
  52. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/_docs/index.rst +0 -0
  53. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/_tools/disk/vdi/generate.sh +0 -0
  54. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/_util.py +0 -0
  55. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/__init__.py +0 -0
  56. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/test_hyperv.py +0 -0
  57. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/test_ovf.py +0 -0
  58. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/test_pvs.py +0 -0
  59. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/test_vbox.py +0 -0
  60. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/descriptor/test_vmx.py +0 -0
  61. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/__init__.py +0 -0
  62. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_asif.py +0 -0
  63. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_hdd.py +0 -0
  64. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_vdi.py +0 -0
  65. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_vhd.py +0 -0
  66. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_vhdx.py +0 -0
  67. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/disk/test_vmdk.py +0 -0
  68. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/util/__init__.py +0 -0
  69. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/util/test_envelope.py +0 -0
  70. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tests/util/test_vmtar.py +0 -0
  71. {dissect_hypervisor-3.21.dev5 → dissect_hypervisor-3.22.dev1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.21.dev5
3
+ Version: 3.22.dev1
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
@@ -176,7 +176,7 @@ class QCow2:
176
176
  return data_file
177
177
 
178
178
  if self.path:
179
- if (data_file_path := self.path.with_name(self.image_data_file)).exists():
179
+ if (data_file_path := self.path.parent.joinpath(self.image_data_file)).exists():
180
180
  return data_file_path.open("rb")
181
181
 
182
182
  if not allow_no_data_file:
@@ -190,7 +190,7 @@ class QCow2:
190
190
  backing_file_path = None
191
191
  if backing_file is None:
192
192
  if self.path:
193
- if (backing_file_path := self.path.with_name(self.auto_backing_file)).exists():
193
+ if (backing_file_path := self.path.parent.joinpath(self.auto_backing_file)).exists():
194
194
  backing_file = backing_file_path.open("rb")
195
195
  elif not allow_no_backing_file:
196
196
  raise Error(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.21.dev5
3
+ Version: 3.22.dev1
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
@@ -72,6 +72,15 @@ def test_data_file() -> None:
72
72
  for i in range(255):
73
73
  assert stream.read(1024 * 1024).strip(bytes([i])) == b"", f"Mismatch at offset {i * 1024 * 1024:#x}"
74
74
 
75
+ # Test with absolute path
76
+ with patch.object(Path, "open", lambda *args: None), patch.object(Path, "exists", return_value=False):
77
+ qcow2.image_data_file = "/absolute/path/to/nothing.qcow2"
78
+ with pytest.raises(
79
+ Error,
80
+ match=r"data-file '(?:[A-Z]:\\+)?[/\\]+absolute[/\\]+path[/\\]+to[/\\]+nothing\.qcow2' not found \(image_data_file = '/absolute/path/to/nothing\.qcow2'\)", # noqa: E501
81
+ ):
82
+ qcow2._open_data_file(None)
83
+
75
84
 
76
85
  def test_backing_file() -> None:
77
86
  file1 = absolute_path("_data/disk/qcow2/backing-chain-1.qcow2.gz")
@@ -136,6 +145,15 @@ def test_backing_file() -> None:
136
145
  assert stream.read(1024 * 1024).strip(b"\x00") == b"Something here four"
137
146
  assert stream.read(1024 * 1024).strip(b"\x00") == b"Something here five"
138
147
 
148
+ # Test with absolute path
149
+ with patch.object(Path, "open", lambda *args: None), patch.object(Path, "exists", return_value=False):
150
+ qcow2.auto_backing_file = "/absolute/path/to/nothing.qcow2"
151
+ with pytest.raises(
152
+ Error,
153
+ match=r"backing-file '(?:[A-Z]:\\+)?[/\\]+absolute[/\\]+path[/\\]+to[/\\]+nothing\.qcow2' not found \(auto_backing_file = '/absolute/path/to/nothing\.qcow2'\)", # noqa: E501
154
+ ):
155
+ qcow2._open_backing_file(None)
156
+
139
157
 
140
158
  def test_snapshot() -> None:
141
159
  with gzip.open(absolute_path("_data/disk/qcow2/snapshot.qcow2.gz"), "rb") as fh: