From c43059a4cfc7f7972162e9bf3313eefc5941c34e Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Thu, 16 Dec 2021 21:02:41 +0100 Subject: [PATCH] pyocf: add get_bytes() function to Volume and Data Signed-off-by: Adam Rutkowski --- tests/functional/pyocf/types/data.py | 4 ++++ tests/functional/pyocf/types/volume.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tests/functional/pyocf/types/data.py b/tests/functional/pyocf/types/data.py index 6e14266..6e6eec3 100644 --- a/tests/functional/pyocf/types/data.py +++ b/tests/functional/pyocf/types/data.py @@ -223,3 +223,7 @@ class Data: m = md5() m.update(string_at(self.handle, self.size)) return m.hexdigest() + + def get_bytes(self): + return string_at(self.handle, self.size) + diff --git a/tests/functional/pyocf/types/volume.py b/tests/functional/pyocf/types/volume.py index e4a31ef..1b54b9d 100644 --- a/tests/functional/pyocf/types/volume.py +++ b/tests/functional/pyocf/types/volume.py @@ -312,6 +312,9 @@ class Volume(Structure): m.update(string_at(self._storage, self.size)) return m.hexdigest() + def get_bytes(self): + return string_at(self._storage, self.size) + class ErrorDevice(Volume): def __init__(