Since killing and reaping of a process is done in separate threads, it's
possible that the reaping report will be ordered before the kill report.
Adjust the test to handle this case by checking for the reaping report
in the entire log output.
Bug: 296555636
Change-Id: I5549b05392e08655655d4aecc4fadec281c489af
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
In rare cases the process reaping time is short enough that it is
reported as 0. Prevent the test from failing in this rare case.
Bug: 296555636
Change-Id: I8484958eb9561ba345008195be8b6a7bd94e9ef3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Doesn't need to be in 'presubmit-large' as it's a small and quick test.
Change-Id: I7a6b78cf3174993361f50d8d7adfdf86c9d20e28
Test: presubmit
Bug: 270214959
Current test will fail in the case when the target process exits before
process_mrelease is called. However this is possible and should not be
treated as an invalid case. Add special handling of this case in the
test.
Bug: 254880957
Test: run lmkd_tests until this case happens
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ica5b28fa52a5f42a771fb9516112e58b66291068
Increase the allocation step to 5MB and decrease the delay between
allocations to 200ms in order to speed up memory consumption and
avoid the test timing out.
Bug: 217478668
Test: atest lmkd_tests:lmkd_tests.LmkdTest#TargetReaping -- --abi x86_64
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia36229b280d79acd9d93a5ca1961d6cf1ef223df
Since lmkd tests require time to build up memory pressure, they cause
timeouts when run as part of presubmits. Move them into the
presubmit-large category with higher timeout to prevent such failures.
Bug: 217478668
Bug: 203597692
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I690133c9f849da58b85884a7d7b463f5b518c12f
Add a test to verify a process killed by lmkd is being reaped when
kernel supports process_mrelease syscall.
Bug: 203597692
Test: atest LmkdTest
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iac46f68c811e6e89378952ce1d29daf8a47514e2
Added SPDX-license-identifier-Apache-2.0 to:
Android.bp
libpsi/Android.bp
tests/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: I5fed190764c763388c50c2fea58c5c421579bd30
Memory cgroups are disabled on non-AndroidGo devices. Change the test
not to fail due to missing in-kernel memory cgroup support.
Bug: 172296409
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I35d724c23c22e97458976c1cad45fe9d993326f9
We introduced supporting process type while
registering a process in lmkd. Thus we need
to set process type when registering the test
unit or lmkd would not be able to kill it.
Bug: 143857475
Test: Verified using lmkd_unit_test
Change-Id: I7bf2b552c242dbdc13bb431248ec9182dccaa599
This change is to align how we get proc_name
between lmkd and lmkd_unit_test or it will always
fail when we run command such as ./lmkd_unit_test
under the device shell.
Bug: 146415484
Test: Verified using lmkd_unit_test
Change-Id: I3a6ebf0747a1054c5758b91fbacf3179b66b56c3
lmkd's test depends on the socket_local_client() function from
libcutils, but since liblog also exposes this symbol weakly, that is
the symbol that gets used instead of the intended libcutil's copy of
the symbol.
Test: build
Change-Id: I294fa157a7f50881bf6360922419976eb1ee3ac7
Excessive number of failed kill reports when lmkd can't find an eligible
process to kill or frees not enough memory pollutes logs and bugreports.
Cleanup kill reports to remove duplicate information and rate limit failed
kill attempts at 1 report per sec. The number of suppressed failed kills
will be reported in the next lmkd report.
Bug: 113864581
Test: Verified using lmkd_unit_test
Change-Id: I67fa1fec97613f136c7582115edcbc56b1503c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
lmkd_unit_test gets an selinux violation when run unprivileged:
lmkd_unit_test: type=1400 audit(0.0:???): avc: denied { search } for
name="lowmemorykiller" dev="sysfs" ino=??? scontext=u:r:shell:s0
tcontext=u:object_r:sysfs_lowmemorykiller:s0 tclass=dir
permissive=0
resulting in log noise. Check for INKERNEL_MINFREE_PATH existence
after known to be escalated as root user to suppress noise.
Test: lmkd_unit_test as unprivileged user, there should be no audits.
Change-Id: Ia5c7824e7070c98ee6eea20ca53097e4e56d61b6
This change allows lmkd-test to work correctly when it's started
using absolute as well as relative path.
Change-Id: Ida58d13d66a224119a363f59cc59289f0167d3c9