Commit Graph

41 Commits

Author SHA1 Message Date
Kamil Lepek
e52d34c1c8 Adapt all python code to PEP8 style standards
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-06-13 17:55:41 +02:00
Adam Rutkowski
4a548d26cf functional tests: only send sector-aligned IO
... to satisfy OCF assumptions.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-06-12 12:07:02 -04:00
Adam Rutkowski
31ab2b3fe6 pyocf: add sector size logic to Size class
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-06-12 12:07:02 -04:00
Adam Rutkowski
641fba1708 Functional tests for WO cache mode
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-06-12 12:07:02 -04:00
Adam Rutkowski
a6312eb8aa Update management tests for WO (Write-only) cache mode
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-06-12 12:07:02 -04:00
Adam Rutkowski
7b7d65e092 pyocf: fix setting data offset in IO
When setting data in IO, the offset should be stored in
IO itself, not data object.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-06-12 12:07:01 -04:00
Michal Rakowski
9f4536c6e3 Error codes in IO path changed to OCF-specific
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-06-05 09:10:54 +02:00
Robert Baldyga
46ae8b2ff1 Remove unused OCF_ERR_CACHE_IN_USE error code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-28 11:20:48 +02:00
Robert Baldyga
8a82be339f Introduce asynchronous cache lock
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-28 11:20:48 +02:00
Jan Musiał
93a06686a7
Merge pull request #165 from robertbaldyga/ctx-get-put
Give ocf_ctx get/put semantics
2019-05-24 14:29:04 +02:00
Robert Baldyga
c903d13ad2 Give ocf_ctx get/put semantics
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-23 15:50:10 +02:00
Michał Mielewczyk
16a01d7698
Merge pull request #157 from KamilLepek/management
Added a few management tests (changing configuration)
2019-05-22 16:20:16 +02:00
Kamil Lepek
ecd492e562 Added a few management tests (changing configuration after start and checking statistics)
Fixed core/cache stats pyocf API

Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-05-22 15:34:07 +02:00
Daniel Madej
3da9059e50
Merge pull request #143 from imjfckm/master
Fix loading of cache in pyocf
2019-05-17 10:59:04 +02:00
Jan Musial
991bcf3491 Fix loading of cache in pyocf
Flush/load metadata paths are heavily dependend on Data behaving
correctly in terms of seeks/position and that needed to be fixed.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-05-10 15:34:23 +02:00
Michal Mielewczyk
7165bc16c3 Add kick function for cleaner
ocf_kick_cleaner() allows to perfom cleaning immediately.

Nop cleaning policy now returns new 'OCF_CLEANER_DISABLE' macro which indicates
that cleaing shouldn't be performed. To enable it back, ocf_kick_cleaner()
should be called.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-05-10 08:09:56 -04:00
Robert Bałdyga
1c9fe96663
Merge pull request #133 from arutk/ajrutkow_async_counters
Extended reference counting
2019-05-08 14:23:50 +02:00
Robert Baldyga
7b88aac56f Remove "interruption" argument from flush() functions
As non-interruptible flushes are no longer triggered from OCF
internals, we can get rid of "interruption" argument and let
adapters handle it themselves.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-07 17:23:19 +02:00
Adam Rutkowski
c8e6b96ece pyocf: remove put from cache stop to match get count
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
2485584487 Remove obsolete ocf_cache_wait_for_io_finish from pyocf
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
93c8932a17 pyocf: fix management queue stop/put
Queue is stopped when reference counter drops to 0, so no need to
manually stop management queue after cache stop - simple put is
enough.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-25 13:21:25 -04:00
Daniel Madej
1aa5e99173 Pyocf tests for start/stop
Tests for starting cache and checking if mode works properly
Tests for stopping cache
Negative and stress tests

Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-04-18 17:00:14 +02:00
Adam Rutkowski
79cb39e273
Merge pull request #129 from imjfckm/master
Fix cores volumes dropping before close
2019-04-18 09:41:33 -04:00
Jan Musial
be88300071 Fix cores volumes dropping before close
* Add references to Cores in Cache, ctx holds caches, caches hold cores,
  everything gets cleaned up nicely

* GC in Python seems to be a bit lazy, if we want to run CI on
  low-memory machines we need to make sure it does run in between tests
  'cause we don't want no huge Volumes hanging around for long

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-18 14:11:59 +02:00
Kamil Łepek
92837ec2f3
Merge pull request #119 from Deixx/tests_neg_io
Negative tests for IO path
2019-04-18 14:06:15 +02:00
Daniel Madej
876294f603 Negative tests for IO path
Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-04-18 12:58:02 +02:00
Jan Musial
75c3948f6d Secure erase tests
Implement simple secure erase tests. Perform IO that will trigger
copying of Data buffers and make sure OCF calls secure erase on them.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-18 12:51:59 +02:00
Michał Mielewczyk
d4e929140e
Merge pull request #127 from arutk/pytest_wait_io
pyocf: wait for pending I/O before cache stop
2019-04-18 09:21:50 +02:00
Katarzyna Łapińska
c80ca4a9a8
Merge pull request #122 from KamilLepek/security_tests
Add security fuzzy tests and improve pyocf api
2019-04-18 07:33:11 +02:00
Adam Rutkowski
d607402f2b pyocf: wait for pending I/O before cache stop
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-17 18:12:56 -04:00
Michal Mielewczyk
5e52ac4ef2 Rename 'printf' field name in logger ops to 'print'.
Due the aggresive security checks in compiler 'printf' might be substituded with
'__printf_chk'. However it does not differentiate whether substituted string is
library function call whether field in structure.

By renaming field we prevent it to be unintentionally subustituted by the
preprocessor.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-04-17 11:37:47 -04:00
Kamil Lepek
d55195ecf5 Add security fuzzy tests and improve pyocf api
Fuzzy tests added for:
changing cache mode
attaching cache device with fuzzed cache line size
setting cleaning policy
setting alru params
setting acp params
setting seq cut off policy per cache
setting seq cut off policy per core
2019-04-17 12:46:25 +02:00
Jan Musial
003d6505aa Fix leaky tests
Fix some instance tracking to prevent Python-side objects from leaking
buffers.
Also, reduce min size of Cache instance (real minimum should be around ~~19MiB,
but we need to make it more deterministic and 20 MiB seems to be reasonable).

Still some stuff left to do, but it needs more investigation and, for
now, this should suffice just to enable some form of CI.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-16 09:55:02 +02:00
Kamil Lepek
5ceb69e9c8 Added cache mode change in pyocf and basic test 2019-04-11 10:57:25 +02:00
Jan Musial
db46a9decb Stop using mgmt queue for IO in pyocf
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-10 11:25:39 +02:00
Daniel Madej
1fa52e84a8 Extract cache.flush() method from cache.stop()
Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-04-04 11:13:45 +02:00
Jan Musial
be773a45af Add remove_core fcn
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-04 10:58:29 +02:00
Jan Musial
753ab00331 Fix core_new_io
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-03 15:48:14 +02:00
Jan Musial
59178eef01 Make libocf.so loading CWD independent
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-03 12:28:15 +02:00
Jan Musial
545d5b8aac Make pyocf work with async API
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-03 11:13:27 +02:00
Michal Rakowski
e5227cef89 Implement pyocf adapter with sample OCF test
PyOCF is a tool written with testing OCF functionality in mind.
It is a Python3 (3.6 version required) package which wraps OCF
by providing Python objects in place of OCF objects (volumes, queues,
etc). Thin layer of translation between OCF objects and PyOCF objects
enables using customized behaviors for OCF primitives by subclassing
PyOCF classes.

This initial version implements only WT and WI modes and single,
synchronously operating Queue.

TO DO:

  - Queues/Cleaner/MetadataUpdater implemented as Python threads
  - Loading of caches from PyOCF Volumes (fix bugs in OCF)
  - Make sure it works multi-threaded for more sophisticated tests

Co-authored-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-03-07 12:48:40 +01:00