Skip to content

Commit a0b8a4c

Browse files
author
k9ert
committed
smartcardtest works
1 parent b726af5 commit a0b8a4c

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/stresstest/core.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,14 @@ async def _test_component_continuously(self, component_name, tester):
221221
return
222222

223223
try:
224-
# Test smartcard reading
224+
current_data = await tester._read_smartcard()
225+
print("Smartcard read:", repr(current_data))
225226
self.statistics['smartcard_reads'] += 1
226-
# Add actual smartcard test here if needed
227+
228+
# Compare with initial value (like original stress test)
229+
if current_data != self.initial_values.get('smartcard'):
230+
self.statistics['mismatches'] += 1
231+
227232
except Exception as e:
228233
self.statistics['smartcard_errors'] += 1
229234
print("Smartcard read error:", str(e))
@@ -233,9 +238,13 @@ async def _test_component_continuously(self, component_name, tester):
233238
return
234239

235240
try:
236-
# Test storage operations
241+
current_data = await tester._read_storage()
237242
self.statistics['storage_reads'] += 1
238-
# Add actual storage test here if needed
243+
244+
# Compare with initial value (like original stress test)
245+
if current_data != self.initial_values.get('storage'):
246+
self.statistics['mismatches'] += 1
247+
239248
except Exception as e:
240249
self.statistics['storage_errors'] += 1
241250
print("Storage read error:", str(e))
@@ -245,9 +254,13 @@ async def _test_component_continuously(self, component_name, tester):
245254
return
246255

247256
try:
248-
# Test SD card operations
257+
current_data = await tester._read_sdcard()
249258
self.statistics['sdcard_reads'] += 1
250-
# Add actual SD card test here if needed
259+
260+
# Compare with initial value (like original stress test)
261+
if current_data != self.initial_values.get('sdcard'):
262+
self.statistics['mismatches'] += 1
263+
251264
except Exception as e:
252265
self.statistics['sdcard_errors'] += 1
253266
print("SD card read error:", str(e))

0 commit comments

Comments
 (0)