[LTP] [PATCH v2 15/33] keyctl23: Test KEYCTL_RESTRICT_KEYRING builtin_trusted

Petr Vorel pvorel@suse.cz
Wed Sep 16 15:26:44 CEST 2026


Hi Cyril,

...
> > +	if (TST_RET == 0)
> > +		tst_res(TPASS, "KEYCTL_RESTRICT_KEYRING builtin_trusted passed");
> > +	else if (TST_RET == -1 && TST_ERR == EEXIST)
> > +		tst_res(TPASS, "KEYCTL_RESTRICT_KEYRING builtin_trusted already active");
> > +	else
> > +		tst_res(TFAIL | TTERRNO, "KEYCTL_RESTRICT_KEYRING builtin_trusted failed");
> > +
> > +	TST_EXP_FAIL(keyctl(KEYCTL_LINK, user_key, ring_builtin, 0, 0),
> > +		     EOPNOTSUPP,
> > +		     "KEYCTL_LINK of non-asymmetric key on builtin_trusted restricted keyring");

> Hmm, we have this pattern in the tests more than once. The second
> iteration is a test on it's own.

> One easy solution to this is to run the test with two iterations in the
> default run. I have a patch that adds the -i default value to the
> tst_test structure I proposed for the runtest generator, if we wire that
> in we can just set .iterations = 2 in the tst_test struct and be done
> with it:

> Subject: [PATCH 08/13] lib: tst_test: Move the iterations to struct tst_test
...

+1, I'll add it to the v3 patchset.

Kind regards,
Petr


More information about the ltp mailing list