[LTP] [PATCH v4 1/5] Add landlock03 test

Andrea Cervesato andrea.cervesato@suse.com
Fri Jul 26 13:44:19 CEST 2024


Hi Petr,

feel free to push with that.

Andrea

On 7/26/24 13:01, Petr Vorel wrote:
> Hi Andrea,
>
> ...
>> +static struct tst_cap dropadmin = {
>> +	.action = TST_CAP_DROP,
>> +	.id = CAP_SYS_ADMIN,
>> +	.name = "CAP_SYS_ADMIN",
>> +};
>> +
>> +static struct tst_cap needadmin = {
>> +	.action = TST_CAP_REQ,
>> +	.id = CAP_SYS_ADMIN,
>> +	.name = "CAP_SYS_ADMIN",
>> +};
> I dared to merge this with very minor change:
>
> +++ testcases/kernel/syscalls/landlock/landlock03.c
> @@ -26,16 +26,15 @@ static int ruleset_fd = -1;
>   static int ruleset_invalid = -1;
>   static int file_fd = -1;
>   
> +#define ID_NAME(x) .id = x, .name = #x
>   static struct tst_cap dropadmin = {
>   	.action = TST_CAP_DROP,
> -	.id = CAP_SYS_ADMIN,
> -	.name = "CAP_SYS_ADMIN",
> +	ID_NAME(CAP_SYS_ADMIN),
>   };
>   
>   static struct tst_cap needadmin = {
>   	.action = TST_CAP_REQ,
> -	.id = CAP_SYS_ADMIN,
> -	.name = "CAP_SYS_ADMIN",
> +	ID_NAME(CAP_SYS_ADMIN),
>   };
>   
>   static struct tcase {




More information about the ltp mailing list