Skip to contentSkip to conversation

request_key04: Use TFAIL instead of TBROK

PATCH New Petr Vorel 5 participants 10 messages Feb 26, 2020

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

To fix unreported results error:
tst_test.c:1036: BROK: Test haven't reported results!

which also prevents to display kernel commit fix and CVE.

Fixes 8ac26843e ("syscalls/request_key04: new test for request_key()

permission check bug")

---
Hi,

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

Kind regards,
Petr

 testcases/kernel/syscalls/request_key/request_key04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/request_key/request_key04.c +1 -1
index da036bf3a..c125f4261 100644
@@ -65,7 +65,7 @@ static void do_test(void)
 	if (TST_ERR == EACCES) {
 		tst_res(TPASS, "request_key() failed with EACCES as expected");
 	} else {
-		tst_res(TBROK | TTERRNO,
+		tst_res(TFAIL | TTERRNO,
 			"request_key() failed with unexpected error code");
 	}
 }
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Quoted 8 lines · Petr Vorel

To fix unreported results error:
tst_test.c:1036: BROK: Test haven't reported results!

which also prevents to display kernel commit fix and CVE.

Fixes 8ac26843e ("syscalls/request_key04: new test for request_key()

permission check bug")

Quoted 9 lines

---
Hi,

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

+1 for this fix.

By the way, do you think it makes sense to add build check parameters for tst_res() too? Just like what we do for tst_brk() in commit 0738e3753c51.

Any thoughts?

Quoted 26 lines

Kind regards,
Petr

 testcases/kernel/syscalls/request_key/request_key04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/request_key/request_key04.c +1 -1
index da036bf3a..c125f4261 100644
@@ -65,7 +65,7 @@ static void do_test(void)
        if (TST_ERR == EACCES) {
                tst_res(TPASS, "request_key() failed with EACCES as
 expected");
        } else {
-               tst_res(TBROK | TTERRNO,
+               tst_res(TFAIL | TTERRNO,
                        "request_key() failed with unexpected error code");
        }

}
--
2.25.1

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200226/2c786714/attachment.htm>
author
#2 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Hi Li,

...

Quoted 6 lines
Quoted 4 lines

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

+1 for this fix.

Thanks for your review.

Quoted 2 lines

By the way, do you think it makes sense to add build check parameters for tst_res() too? Just like what we do for tst_brk() in commit 0738e3753c51.

IMHO if we agree that tst_res(TBROK) is harmful and should be avoided entirely, I'd be for adding this check.

Quoted 1 line

Any thoughts?

Kind regards,
Petr

#3 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Quoted 8 lines · Petr Vorel

Hi Li,

...

Quoted 4 lines
Quoted 4 lines

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

Quoted 9 lines
Quoted 1 line

+1 for this fix.

Thanks for your review.

Quoted 2 lines

By the way, do you think it makes sense to add build check parameters for tst_res() too? Just like what we do for tst_brk() in commit 0738e3753c51.

IMHO if we agree that tst_res(TBROK) is harmful and should be avoided entirely,

I agree.

Quoted 2 lines

I'd be for adding this check.

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200226/36e6d613/attachment.htm>
author
#4 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Hi Li,

Quoted 15 lines
Quoted 6 lines

...

Quoted 4 lines
Quoted 4 lines

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

Quoted 8 lines
Quoted 1 line

+1 for this fix.

Thanks for your review.

Quoted 2 lines

By the way, do you think it makes sense to add build check parameters for tst_res() too? Just like what we do for tst_brk() in commit 0738e3753c51.

IMHO if we agree that tst_res(TBROK) is harmful and should be avoided entirely,

Quoted 7 lines

I agree.

Quoted 1 line

I'd be for adding this check.

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

+1. Cyril, Jan?

Kind regards,
Petr

#5 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Quoted 11 lines · Petr Vorel

Hi Li,

Quoted 9 lines
Quoted 9 lines

...

Quoted 5 lines
Quoted 4 lines

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

+1 for this fix.

Thanks for your review.

Quoted 2 lines

By the way, do you think it makes sense to add build check parameters for tst_res() too? Just like what we do for tst_brk() in commit 0738e3753c51.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

IMHO if we agree that tst_res(TBROK) is harmful and should be avoided entirely,

I agree.

Quoted 1 line

I'd be for adding this check.

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

+1. Cyril, Jan?

Hi Petr,

It is OK for me to add this check. :-)

Thanks,
Xiao Yang

Quoted 3 lines

Kind regards,
Petr

#6 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

In reply to Petr Vorel

Hi!

Quoted 3 lines
Quoted 2 lines

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

+1. Cyril, Jan?

I guess that it does not make much sense to report TBROK and then continue the test. But that all depends on how exactly are these states defined. Have we ever wrote them down?

I guess that TPASS and TFAIL are obvious.

TINFO is just additional information.

TCONF is test skipped.

TWARN something went wrong but we decided to continue?

TBROK something went wrong and we decided to exit?

Signature · 2 lines
Cyril Hrubis
[email protected]
#7 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

----- Original Message -----

Quoted 9 lines

Hi!

Quoted 3 lines
Quoted 2 lines

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

+1. Cyril, Jan?

I guess that it does not make much sense to report TBROK and then continue the test. But that all depends on how exactly are these states defined. Have we ever wrote them down?

Quoted 7 lines

I guess that TPASS and TFAIL are obvious.

TINFO is just additional information.

TCONF is test skipped.

TWARN something went wrong but we decided to continue?

This appears to be mostly used in cleanup() when something goes wrong. So a failure that's not critical, not related to goal of test, but still something we want to draw attention to.

Quoted 2 lines

TBROK something went wrong and we decided to exit?

We do have following in style-guide.txt:

Use +TBROK+ when an unexpected failure unrelated to the goal of the testcase occurred, and use +TFAIL+ when an unexpected failure related to the goal of the testcase occurred.

I agree that tst_res with TBROK doesn't make much sense. I see TBROK as something we can't recover from and need to end the test. Otherwise if we want to skip part of test, then TCONF looks more fitting.

author
#8 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

Hi,

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

In personally, I'd let tst_res() only accept 'TPASS, TFAIL, TINFO, TCONF, TWARN'.

+1. Cyril, Jan?

I guess that it does not make much sense to report TBROK and then continue the test. But that all depends on how exactly are these states defined. Have we ever wrote them down?

Quoted 7 lines
Quoted 7 lines

I guess that TPASS and TFAIL are obvious.

TINFO is just additional information.

TCONF is test skipped.

TWARN something went wrong but we decided to continue?

+1

Quoted 9 lines

This appears to be mostly used in cleanup() when something goes wrong. So a failure that's not critical, not related to goal of test, but still something we want to draw attention to.

Quoted 1 line

TBROK something went wrong and we decided to exit?

We do have following in style-guide.txt:

Quoted 7 lines

Use +TBROK+ when an unexpected failure unrelated to the goal of the testcase occurred, and use +TFAIL+ when an unexpected failure related to the goal of the testcase occurred.

I agree that tst_res with TBROK doesn't make much sense. I see TBROK as something we can't recover from and need to end the test. Otherwise if we want to skip part of test, then TCONF looks more fitting.

Thanks all for their input.
I'll merge this test with your ack and create macro + fix remaining tests (sent patchset to ML).

Kind regards,
Petr

#9 lore raw

PATCH 1/1 request_key04: Use TFAIL instead of TBROK

In reply to Petr Vorel

----- Original Message -----

Quoted 38 lines

To fix unreported results error:
tst_test.c:1036: BROK: Test haven't reported results!

which also prevents to display kernel commit fix and CVE.

Fixes 8ac26843e ("syscalls/request_key04: new test for request_key()

permission check bug")

---
Hi,

obvious fix which I'd normally merge without sending to ML. But there are 19 tests which use tst_res(TBROK, and at least some of them are affected by this (i.e. don't unconditionally report any result before tst_res(TBROK), so we might want to fix it different way.

Kind regards,
Petr

 testcases/kernel/syscalls/request_key/request_key04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/request_key/request_key04.c +1 -2
index da036bf3a..c125f4261 100644
@@ -65,7 +65,7 @@ static void do_test(void)
 	if (TST_ERR == EACCES) {
 		tst_res(TPASS, "request_key() failed with EACCES as expected");
 	} else {
-		tst_res(TBROK | TTERRNO,
+		tst_res(TFAIL | TTERRNO,
 			"request_key() failed with unexpected error code");
 	}
 }
--
Quoted 1 line

2.25.1

Ack