add connection_type to dummies

This commit is contained in:
2025-12-06 23:16:33 +01:00
parent b545f9e326
commit b85ff21648
3 changed files with 7 additions and 20 deletions

View File

@ -18,7 +18,6 @@ IPC_CREAT = 0o1000
terminate = False
class TDriveData(ctypes.Structure):
_fields_ = [
("caDriveIndex", ctypes.c_char * STR_BUFFER_SIZE),
@ -29,6 +28,7 @@ class TDriveData(ctypes.Structure):
("caDriveShredDuration", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveCapacity", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveState", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveConnectionType", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveModelFamily", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveModelName", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveSerialnumber", ctypes.c_char * STR_BUFFER_SIZE),
@ -75,6 +75,7 @@ def create_drive_objects(drive_info):
smart_error_count=int(drive_info["driveErrors"]),
shred_timestamp=int(drive_info["driveShredTimestamp"]),
shred_duration=int(drive_info["driveShredDuration"]),
connection_type=drive_info["driveConnectionType"],
)
rehdd_info = layouter.ReHddInfo(
@ -88,8 +89,8 @@ def create_drive_objects(drive_info):
def worker(queue_id, test_mode=False):
try:
while not terminate:
time.sleep(3)
if test_mode:
time.sleep(3)
drive_info = {
"driveIndex": "42",
"driveHours": 44,
@ -99,6 +100,7 @@ def worker(queue_id, test_mode=False):
"driveShredDuration": 0,
"driveCapacity": 42,
"driveState": "shredded",
"driveConnectionType": "sata",
"driveModelFamily": "modelFamily",
"driveModelName": "modelName",
"driveSerialnumber": "serial",
@ -145,6 +147,7 @@ def worker(queue_id, test_mode=False):
),
"driveCapacity": int(d.caDriveCapacity.decode().strip("\x00")),
"driveState": d.caDriveState.decode().strip("\x00"),
"driveConnectionType": d.caDriveConnectionType.decode().strip("\x00"),
"driveModelFamily": d.caDriveModelFamily.decode().strip("\x00"),
"driveModelName": d.caDriveModelName.decode().strip("\x00"),
"driveSerialnumber": d.caDriveSerialnumber.decode().strip("\x00"),