def check(self):
if self.ver[0] > self.ver_expected[0]:
- self.result = f'OK: version >= {self.ver_expected[0]}.{self.ver_expected[1]}'
+ self.result = f'OK: version >= {self.ver_expected}'
return
if self.ver[0] < self.ver_expected[0]:
- self.result = f'FAIL: version < {self.ver_expected[0]}.{self.ver_expected[1]}'
+ self.result = f'FAIL: version < {self.ver_expected}'
return
- if self.ver[1] >= self.ver_expected[1]:
- self.result = f'OK: version >= {self.ver_expected[0]}.{self.ver_expected[1]}'
+ # self.ver[0] and self.ver_expected[0] are equal
+ if self.ver[1] > self.ver_expected[1]:
+ self.result = f'OK: version >= {self.ver_expected}'
return
- self.result = f'FAIL: version < {self.ver_expected[0]}.{self.ver_expected[1]}'
+ if self.ver[1] < self.ver_expected[1]:
+ self.result = f'FAIL: version < {self.ver_expected}'
+ return
+ # self.ver[1] and self.ver_expected[1] are equal too
+ if self.ver[2] >= self.ver_expected[2]:
+ self.result = f'OK: version >= {self.ver_expected}'
+ return
+ self.result = f'FAIL: version < {self.ver_expected}'
def table_print(self, _mode, with_results):
- ver_req = f'kernel version >= {self.ver_expected[0]}.{self.ver_expected[1]}'
+ ver_req = f'kernel version >= {self.ver_expected}'
print(f'{ver_req:<91}', end='')
if with_results:
print(f'| {colorize_result(self.result)}', end='')