functional tests: only send sector-aligned IO
... to satisfy OCF assumptions. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -107,7 +107,13 @@ class Data:
|
||||
|
||||
@classmethod
|
||||
def from_string(cls, source: str, encoding: str = "ascii"):
|
||||
return cls.from_bytes(bytes(source, encoding))
|
||||
b = bytes(source, encoding)
|
||||
# duplicate string to fill space up to sector boundary
|
||||
padding_len = S.from_B(len(b), sector_aligned = True).B - len(b)
|
||||
padding = b * (padding_len // len(b) + 1)
|
||||
padding = padding[:padding_len]
|
||||
b = b + padding
|
||||
return cls.from_bytes(b)
|
||||
|
||||
@staticmethod
|
||||
@DataOps.ALLOC
|
||||
|
||||
Reference in New Issue
Block a user