fix remain_lifetime_percentage

This commit is contained in:
Cayo Puigdefabregas 2022-09-28 11:10:34 +02:00
parent 2aa8f95817
commit ab06bd5f44
1 changed files with 8 additions and 0 deletions

View File

@ -296,6 +296,14 @@ class TestDataStorage(Test):
offline_uncorrectable = Integer(data_key='offlineUncorrectable')
remaining_lifetime_percentage = Integer(data_key='remainingLifetimePercentage')
@post_load
def default_remaining_lifetime_percentage(self, data):
if not data.get('remaining_lifetime_percentage'):
return
if data.get('remaining_lifetime_percentage') > 100:
data['remaining_lifetime_percentage'] = 100
class StressTest(Test):
__doc__ = m.StressTest.__doc__