diff --git a/tests/functional/pyocf/types/volume.py b/tests/functional/pyocf/types/volume.py index dee0d2a5..84181552 100644 --- a/tests/functional/pyocf/types/volume.py +++ b/tests/functional/pyocf/types/volume.py @@ -349,19 +349,35 @@ def reset_stats(self): class TraceDevice(Volume): + class IoType(IntEnum): + Data = 1 + Flush = 2 + Discard = 3 + def __init__(self, size, trace_fcn=None, uuid=None): super().__init__(size, uuid) self.trace_fcn = trace_fcn - def submit_io(self, io): + def _trace(self, io, io_type): submit = True if self.trace_fcn: - submit = self.trace_fcn(self, io) + submit = self.trace_fcn(self, io, io_type) + + return submit + + def submit_io(self, io): + submit = self._trace(io, TraceDevice.IoType.Data) if submit: super().submit_io(io) + def submit_flush(self, io): + submit = self._trace(io, TraceDevice.IoType.Flush) + + if submit: + super().submit_flush(io) + lib = OcfLib.getInstance() lib.ocf_io_get_priv.restype = POINTER(VolumeIoPriv)