[systemd-devel] [PATCHv2] test: do not use last cap from kernel in test-cap-list

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Dec 25 08:20:59 PST 2014


On Tue, Dec 23, 2014 at 01:51:40PM -0800, Filipe Brandenburger wrote:
> The new test-cap-list introduced in commit 2822da4fb7f891 uses the included
> table of capabilities. However, it uses cap_last_cap() which probes the kernel
> for the last available capability. On an older kernel (e.g. 3.10 from RHEL 7)
> that causes the test to fail with the following message:
> 
>     Assertion '!capability_to_name(cap_last_cap()+1)' failed at src/test/test-cap-list.c:30, function main(). Aborting.
> 
> Fix it by exporting the size of the static table and using it in the test
> instead of the dynamic one from the current kernel.
> 
> Tested by successfully running ./test-cap-list and the whole `make check` test
> suite with this patch on a RHEL 7 host.
> ---
> v2: Updated the patch to also consider the changes introduced in commit
> 4b7c1d5d6a0060 ("test-cap-list: always check libcap comes to the same names...")
Applied.

Zbyszek


More information about the systemd-devel mailing list