OSDN Git Service

selftests: pmtu: Introduce support for multiple tests
authorStefano Brivio <sbrivio@redhat.com>
Sat, 17 Mar 2018 01:31:41 +0000 (02:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Mar 2018 00:15:14 +0000 (20:15 -0400)
commit36455bd1e977ef1ccd8e89018bd14d0a5b96b4e5
treef0414f75f64542036adf16b33f215558503cad65
parentf2c929feeccd3d56be284b9e24e04cd3c4779a4f
selftests: pmtu: Introduce support for multiple tests

Introduce list of tests and their descriptions, and loop on it
in main body.

Tests will now just take care of calling setup with a list of
"units" they need, and return 0 on success, 1 on failure, 2 if
the test had to be skipped.

Main script body will take care of displaying results and
cleaning up after every test. Introduce guard variable so that
we don't clean up twice in case of interrupts or unexpected
failures.

The pmtu_vti6_exception test can now run its third step even if
the previous one failed, as we can return values from it.

Also introduce support to display test descriptions, and display
aligned OK/FAIL/SKIP test outcomes. Buffer error strings so that
in case of failure we can display them right under the outcome
for each test.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/pmtu.sh