Skip to content

Commit

Permalink
request_key02: Use TST_EXP_FAIL2() test macro
Browse files Browse the repository at this point in the history
+ make checkpatch.pl happy.

Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Jul 30, 2024
1 parent e8eb528 commit b5b92eb
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions testcases/kernel/syscalls/request_key/request_key02.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,9 @@ static void verify_request_key(unsigned int n)
{
struct test_case *tc = tcases + n;

TEST(request_key("keyring", tc->des, NULL, *tc->id));
if (TST_RET != -1) {
tst_res(TFAIL, "request_key() succeed unexpectly");
return;
}

if (TST_ERR == tc->exp_err) {
tst_res(TPASS | TTERRNO, "request_key() failed expectly");
return;
}

tst_res(TFAIL | TTERRNO, "request_key() failed unexpectly, "
"expected %s", tst_strerrno(tc->exp_err));
TST_EXP_FAIL2(request_key("keyring", tc->des, NULL, *tc->id),
tc->exp_err, "request_key(\"keyring\", %s, NULL, %d)",
tc->des, *tc->id);
}

static int init_key(char *name, int cmd)
Expand All @@ -65,9 +55,8 @@ static int init_key(char *name, int cmd)
tst_brk(TBROK | TERRNO, "add_key() failed");

if (cmd == KEYCTL_REVOKE) {
if (keyctl(cmd, n) == -1) {
if (keyctl(cmd, n) == -1)
tst_brk(TBROK | TERRNO, "failed to revoke a key");
}
}

if (cmd == KEYCTL_SET_TIMEOUT) {
Expand Down

0 comments on commit b5b92eb

Please sign in to comment.