Re: [PATCH net-next v2 4/4] selftests: net: adopt harness for flow label mgr

Jakub Kicinski <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.network
Message-ID <[email protected]>
On Mon,  3 Aug 2026 23:59:10 -0300 Marcelo Mendes Spessoto Junior wrote:
> +TEST(cannot_put_non_existent_label)
> +{
> +	int fd, err;
> +
> +	fd = socket(PF_INET6, SOCK_DGRAM, 0);
> +	ASSERT_GE(fd, 0) TH_LOG("socket failed");
> +
> +	err = flowlabel_put(fd, 10);
> +	ASSERT_TRUE(err) TH_LOG("expected put of a non-existent label to fail");
> +	ASSERT_EQ(ESRCH, errno) TH_LOG("expected ESRCH, got %d", errno);

nit: I think you're using ASSERTS where EXPECT should be used.
My understanding is that EXPECT is better if the test can continue.

> +	ASSERT_EQ(0, close(fd));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.