Skip to contentSkip to conversation

known-fail test tag

PATCH In review Petr Vorel 2 participants 6 messages Jan 14, 2022 – Jan 17, 2022 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

v3 cover known-fail test tag

Hi,

changes v2->v3:
* new commit: testinfo.pl: Support tag values on more lines
* use URL

Petr Vorel (3):
lib: Add known-fail test tag
testinfo.pl: Support tag values on more lines ustat0{1,2}: Mark failure on Btrfs with known-fail tag

 doc/c-test-api.txt                        |  1 +
 docparse/testinfo.pl                      | 17 ++++++++++++++++-
 lib/tst_test.c                            |  8 ++++++--
 testcases/kernel/syscalls/ustat/ustat01.c |  6 ++++++
 testcases/kernel/syscalls/ustat/ustat02.c |  6 ++++++
 5 files changed, 35 insertions(+), 3 deletions(-)
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

PATCH v3 1/3 lib: Add known-fail test tag

to save test reviewers time.

---
 doc/c-test-api.txt   |  1 +
 docparse/testinfo.pl | 11 ++++++++++-
 lib/tst_test.c       |  8 ++++++--
 3 files changed, 17 insertions(+), 3 deletions(-)
doc/c-test-api.txt +1 -0
index 123d3f1fc9..b8bf5fc11b 100644
@@ -2259,6 +2259,7 @@ struct tst_test test = {
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "9392a27d88b9"},
 		{"linux-git", "ff002b30181d"},
+		{"known-fail", "ustat() is known to fail with EINVAL on Btrfs"},
 		{"linux-stable-git", "c4a23c852e80"},
 		{"CVE", "2020-29373"},
 		{}
docparse/testinfo.pl +10 -1
index 891619532f..8712a530f8 100755
@@ -74,6 +74,10 @@ sub tag_url {
 		return eval("main::$key") . $value;
 	}
 
+	if ('known-fail') {
+		return '';
+	}
+
 	die("unknown constant '$key' for tag $tag, define it!");
 }
 
@@ -432,6 +436,7 @@ sub content_all_tests
 			}
 			my $k = @$tag[0];
 			my $v = @$tag[1];
+			my $url;
 
 			if (defined($$git_url{$k})) {
 				$commits{$k} = () unless (defined($commits{$k}));
@@ -443,7 +448,11 @@ sub content_all_tests
 				$v .= ' ("' . $commits{$k}{$v} . '")';
 			}
 
-			$v = html_a(tag_url($k, @$tag[1]), $v);
+			$url = tag_url($k, @$tag[1]);
+			if ($url) {
+				$v = html_a($url, $v);
+			}
+
 			$content .= "\n|" . reference($k) . "\n|$v\n";
 			$tmp2 = 1;
 		}
lib/tst_test.c +6 -2
index 262626312c..844756fbd7 100644
@@ -763,10 +763,13 @@ static void print_failure_hint(const char *tag, const char *hint,
 				hint_printed = 1;
 				fprintf(stderr, "\n");
 				print_colored("HINT: ");
-				fprintf(stderr, "You _MAY_ be %s, see:\n\n", hint);
+				fprintf(stderr, "You _MAY_ be %s:\n\n", hint);
 			}
 
-			fprintf(stderr, "%s%s\n", url, tags[i].value);
+			if (url)
+				fprintf(stderr, "%s%s\n", url, tags[i].value);
+			else
+				fprintf(stderr, "%s\n", tags[i].value);
 		}
 	}
 }
@@ -779,6 +782,7 @@ static void print_failure_hints(void)
 					   LINUX_STABLE_GIT_URL);
 	print_failure_hint("glibc-git", "missing glibc fixes", GLIBC_GIT_URL);
 	print_failure_hint("CVE", "vulnerable to CVE(s)", CVE_DB_URL);
+	print_failure_hint("known-fail", "hit by known kernel failures", NULL);
 }
 
 static void do_exit(int ret)
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw

PATCH v3 2/3 testinfo.pl: Support tag values on more lines

In reply to Petr Vorel

if value is too long, i.e. adding URL:

.tags = (const struct tst_tag[]) {
	{"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see "
		"https://lore.kernel.org/linux-btrfs/[email protected]/"
	},
	{}
---
 docparse/testinfo.pl | 6 ++++++
 1 file changed, 6 insertions(+)
docparse/testinfo.pl +6 -0
index 8712a530f8..67e435d794 100755
@@ -453,6 +453,12 @@ sub content_all_tests
 				$v = html_a($url, $v);
 			}
 
+			# tag value value can be split into more lines if too long
+			# i.e. URL in known-fail
+			for (@$tag[2 .. $#$tag]) {
+				$v .= " $_";
+			}
+
 			$content .= "\n|" . reference($k) . "\n|$v\n";
 			$tmp2 = 1;
 		}
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

PATCH v3 3/3 ustat0{1, 2}: Mark failure on Btrfs with known-fail tag

In reply to Petr Vorel

ustat() has been always broken on Btrfs and it's unlikely to be fixed due ustat() being deprecated (glibc doesn't expose this system call anymore).

---
 testcases/kernel/syscalls/ustat/ustat01.c | 6 ++++++
 testcases/kernel/syscalls/ustat/ustat02.c | 6 ++++++
 2 files changed, 12 insertions(+)
testcases/kernel/syscalls/ustat/ustat01.c +6 -0
index 0252858beb..66dbc0b184 100644
@@ -44,6 +44,12 @@ static void setup(void)
 static struct tst_test test = {
 	.test_all = run,
 	.setup = setup,
+	.tags = (const struct tst_tag[]) {
+		{"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see"
+			"https://lore.kernel.org/linux-btrfs/[email protected]/"
+		},
+		{}
+	}
 };
 #else
 TST_TEST_TCONF("testing ustat requires <sys/ustat.h> or <linux/types.h>");
testcases/kernel/syscalls/ustat/ustat02.c +6 -0
index d08446eaa1..55bdcaedf8 100644
@@ -63,6 +63,12 @@ static struct tst_test test = {
 	.test = run,
 	.setup = setup,
 	.tcnt = ARRAY_SIZE(tc),
+	.tags = (const struct tst_tag[]) {
+		{"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see"
+			"https://lore.kernel.org/linux-btrfs/[email protected]/"
+		},
+		{}
+	}
 };
 #else
 TST_TEST_TCONF("testing ustat requires <sys/ustat.h> or <linux/types.h>");
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on the v3 series
#4 lore raw
In reply to Petr Vorel

Hi!
Looks good, there may be a minor things that can be adjusted later, but I would like to get this in before the release so:

Reviewed-by Cyril Hrubis
Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#5 lore raw

Hi Cyril,

Quoted 5 lines

Hi!
Looks good, there may be a minor things that can be adjusted later, but I would like to get this in before the release so:

Reviewed-by Cyril Hrubis

OK, merged as is. Thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp