From: Leonard Crestez <cdleonard@gmail.com>
To: David Ahern <dsahern@gmail.com>, Shuah Khan <shuah@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Ido Schimmel <idosch@nvidia.com>,
Seth David Schoen <schoen@loyalty.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>,
David Ahern <dsahern@kernel.org>,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 08/11] selftests: net/fcnal: Replace sleep after server start with -k
Date: Wed, 10 Nov 2021 15:54:56 +0200 [thread overview]
Message-ID: <dfe10fec-b2d8-16c0-ae20-6839f47b2809@gmail.com> (raw)
In-Reply-To: <888962dc-8d55-4875-cf44-c0b8ebaa1978@gmail.com>
On 10/7/21 4:22 AM, David Ahern wrote:
> On 10/6/21 3:35 PM, Leonard Crestez wrote:
>>
>> I counted the [FAIL] or [ OK ] markers but not the output of nettest
>> itself. I don't know what to look for, I guess I could diff the outputs?
>>
>> Shouldn't it be sufficient to compare the exit codes of the nettest client?
>
> mistakes happen. The 700+ tests that exist were verified by me when I
> submitted the script - that each test passes when it should and fails
> when it should. "FAIL" has many reasons. I tried to have separate exit
> codes for nettest.c to capture the timeouts vs ECONNREFUSED, etc., but I
> could easily have made a mistake. scanning the output is the best way.
> Most of the 'supposed to fail' tests have a HINT saying why it should fail.
It is not good to have a test for which correctness is ambiguous to such
an extent, it makes reliable future changes difficult. In theory an
uniform TAP format is supposed to solve this but it is not applied
inside selftests/net.
I attempted to write a script to compare two logs in their current
format: https://gitlab.com/cdleonard/kselftest-parse-nettest-fcnal
It does a bunch of nasty scrubbing of irrelevant behavior and got it to
the point where no diffs are found between repeated runs on the same
machine.
One nasty issue was that many tests kill processes inside log_test so
relevant output may be shown either before or after the "TEST: " result
line. This was solved by associating output until the next ### with
previous test.
>> The output is also modified by a previous change to not capture server
>> output separately and instead let it be combined with that of the
>> client. That change is required for this one, doing out=$(nettest -k)
>> does not return on fork unless the pipe is also closed.
>>
>> I did not look at your change, mine is relatively minimal because it
>> only changes who decide when the server goes into the background: the
>> shell script or the server itself. This makes it work very easily even
>> for tests with multiple server instances.
>
> The logging issue is why I went with 1 binary do both server and client
> after nettest.c got support for changing namespaces.
It's possible to just compare the "client" and "server" logs separately
by sorting them on their prefix.
I think a decent approach would be to do a bulk replace for all
"run_cmd{,_nsb,_nsc} nettest" with a new "run_nettest" function that
passes all arguments to nettest itself. That run_nettest function could
include a leading common "-t" arg that is parsed at the top of
fcnal-test.sh.
--
Regards,
Leonard
next prev parent reply other threads:[~2021-11-10 13:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 11:47 [PATCH 00/11] selftests: Improve nettest and net/fcnal-test.sh Leonard Crestez
2021-10-06 11:47 ` [PATCH 01/11] selftests: net/fcnal: Fix {ipv4,ipv6}_bind not run by default Leonard Crestez
2021-10-06 14:37 ` David Ahern
2021-10-06 11:47 ` [PATCH 02/11] selftests: net/fcnal: Mark unknown -t or TESTS value as error Leonard Crestez
2021-10-06 14:37 ` David Ahern
2021-10-06 11:47 ` [PATCH 03/11] selftests: net/fcnal: Non-zero exit on failures Leonard Crestez
2021-10-06 14:37 ` David Ahern
2021-10-06 11:47 ` [PATCH 04/11] selftests: net/fcnal: Use accept_dad=0 to avoid setup sleep Leonard Crestez
2021-10-06 14:38 ` David Ahern
2021-10-06 11:47 ` [PATCH 05/11] selftests: net/fcnal: kill_procs via spin instead of sleep Leonard Crestez
2021-10-06 14:45 ` David Ahern
2021-10-06 21:16 ` Leonard Crestez
2021-10-06 11:47 ` [PATCH 06/11] selftests: net/fcnal: Do not capture do_run_cmd in verbose mode Leonard Crestez
2021-10-06 14:48 ` David Ahern
2021-10-06 11:47 ` [PATCH 07/11] selftests: nettest: Implement -k to fork after bind or listen Leonard Crestez
2021-10-06 11:47 ` [PATCH 08/11] selftests: net/fcnal: Replace sleep after server start with -k Leonard Crestez
2021-10-06 14:54 ` David Ahern
2021-10-06 21:35 ` Leonard Crestez
2021-10-07 1:22 ` David Ahern
2021-11-10 13:54 ` Leonard Crestez [this message]
2021-10-06 11:47 ` [PATCH 09/11] selftests: nettest: Convert timeout to miliseconds Leonard Crestez
2021-10-06 14:56 ` David Ahern
2021-10-06 11:47 ` [PATCH 10/11] selftests: nettest: Add NETTEST_CLIENT,SERVER}_TIMEOUT envvars Leonard Crestez
2021-10-06 14:59 ` David Ahern
2021-10-06 11:47 ` [PATCH 11/11] selftests: net/fcnal: Reduce client timeout Leonard Crestez
2021-10-06 15:01 ` David Ahern
2021-10-06 21:26 ` Leonard Crestez
2021-10-07 1:17 ` David Ahern
2021-10-07 20:52 ` Leonard Crestez
2021-10-08 3:01 ` David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dfe10fec-b2d8-16c0-ae20-6839f47b2809@gmail.com \
--to=cdleonard@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=schoen@loyalty.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).