Skip to content
Snippets Groups Projects
Commit 4e04bea9 authored by Justus Müller's avatar Justus Müller :bee:
Browse files

feat: Make pattern changeable

parent 5f0d3ef2
No related branches found
No related tags found
No related merge requests found
...@@ -134,7 +134,7 @@ class DriveHandle: ...@@ -134,7 +134,7 @@ class DriveHandle:
return True return True
return False return False
def write_pattern(self) -> None: def write_pattern(self, symbol: chr) -> None:
""" """
Writes the pattern file to the disk Writes the pattern file to the disk
...@@ -142,7 +142,7 @@ class DriveHandle: ...@@ -142,7 +142,7 @@ class DriveHandle:
symbol (chr): The symbol the pattern file shall be filled with symbol (chr): The symbol the pattern file shall be filled with
""" """
print(colored("[DriveHandle] Writing a pattern to the raw disk.", "light_grey")) print(colored("[DriveHandle] Writing a pattern to the raw disk.", "light_grey"))
pattern_symbol: bytes = b'A' * 512 pattern_symbol: bytes = symbol.encode() * 512
progressbar = Spinner('[DriveHandle] Writing the pattern') progressbar = Spinner('[DriveHandle] Writing the pattern')
volume_path = subprocess.check_output(['powershell.exe', f'(Get-Volume -DriveLetter {self._drive_letter}).UniqueID']).decode("utf-8").replace("\r\n", "") volume_path = subprocess.check_output(['powershell.exe', f'(Get-Volume -DriveLetter {self._drive_letter}).UniqueID']).decode("utf-8").replace("\r\n", "")
......
...@@ -27,7 +27,7 @@ class SlackTest(DecisionTest): ...@@ -27,7 +27,7 @@ class SlackTest(DecisionTest):
print(colored("[SlackTest] Running the slack test!", 'light_blue')) print(colored("[SlackTest] Running the slack test!", 'light_blue'))
# create pattern # create pattern
self.drive_handle.write_pattern() self.drive_handle.write_pattern('A')
self.drive_handle.flush_cache() self.drive_handle.flush_cache()
print("[SlackTest] Waiting 120s for OS to flush the cache...") print("[SlackTest] Waiting 120s for OS to flush the cache...")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment