Add new tests to check the correctness of the `-overcommit memlock`
option (possible values: off, on, on-fault) by using
`/proc/{qemu_pid}/status` file to check in VmSize, VmRSS and VmLck values:
* if `memlock=off`, then VmLck = 0;
* if `memlock=on`, then VmLck > 0 and almost all memory is resident;
* if `memlock=on-fault`, then VmLck > 0 and only few memory is resident.
On `memlock=on` and `memlock=on-fault` VmLck will be the same.
---
v7 -> v8:
* rewrite test, using process status file instead of smaps
for checking overcommit option;
* change error handling on opening status file;
* add SPDX identifier.
v6 -> v7:
* add skipTest if can't open smaps file of qemu process
v5 -> v6:
* add python3 shebang to tests/functional/test_memlock.py
v4 -> v5:
* refactor skipLockedMemoryTest decorator: using resource.getrlimit()
function instead of spawning a process
v3 -> v4:
* add skipLockedMemoryTest decorator to skip test if system's locked
memory limit is below the required threashold;
* add to MemlockTest skipLockedMemoryTest decorator with 2 GB limit.
v2 -> v3:
Move tests to tests/functional dir, as the tests/avocado dir is being
phased out.
v2 was [PATCH v2] tests/avocado: add memlock tests.
Supersedes: <20250414075702.9248-1-dtalexundeer@yandex-team.ru>
v1 -> v2:
In the previous send, i forgot to specify new patch version (v2)
So i resend previous patch with version specified.
Alexandr Moshkov (2):
tests/functional: add skipLockedMemoryTest decorator
tests/functional: add memlock tests
tests/functional/meson.build | 1 +
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/decorators.py | 18 ++++++
tests/functional/test_memlock.py | 79 ++++++++++++++++++++++++
4 files changed, 99 insertions(+), 1 deletion(-)
create mode 100755 tests/functional/test_memlock.py
--
2.34.1