From b103fc49ae160fdce221c2fffa98dde9bc0ff3b0 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 9 Sep 2024 15:28:24 +0000 Subject: [PATCH] netinet tests: Make some tests more reliable when run in parallel Many of the modified tests add epair interfaces to the host, though most of the tests themselves run in a VNET jail. scapy in particular becomes unhappy when the list of interfaces changes as it is running, so, to improve reliability of parallel test runs, isolate tests which add epairs to the host. Also serialize arp tests, as they examine the dmesg as part of the test. The list of modified tests is not exhaustive, it was determined by running the test suite with parallelization enabled and looking at failures. It may be easier to just automatically enable VNET jailing of all netinet tests, but let's be more particular for now. Reviewed by: kp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46606 --- tests/sys/netinet/Makefile | 11 +++++++++-- tests/sys/netinet6/Makefile | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index 7e12dae6a4f..a6f07d13572 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -27,8 +27,15 @@ ATF_TESTS_SH= arp \ ATF_TESTS_PYTEST+= carp.py ATF_TESTS_PYTEST+= igmp.py -TEST_METADATA.divert+= required_programs="python" -TEST_METADATA.forward+= required_programs="python" +# Some of the arp tests look for log messages in the dmesg buffer, so run them +# serially to avoid problems with interleaved output. +TEST_METADATA.arp+= is_exclusive="true" +TEST_METADATA.divert+= required_programs="python" \ + execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.forward+= required_programs="python" \ + execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" TEST_METADATA.output+= required_programs="python" TEST_METADATA.redirect+= required_programs="python" TEST_METADATA.tcp6_v4mapped_bind_test+= is_exclusive="true" diff --git a/tests/sys/netinet6/Makefile b/tests/sys/netinet6/Makefile index 45e88b50164..753571fbf7a 100644 --- a/tests/sys/netinet6/Makefile +++ b/tests/sys/netinet6/Makefile @@ -16,7 +16,23 @@ ATF_TESTS_SH= exthdr \ ndp \ proxy_ndp -TEST_METADATA.output6+= required_programs="python" +TEST_METADATA.divert+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.exthdr+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.forward6+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.ndp+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.output6+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" \ + required_programs="python" +TEST_METADATA.proxy_ndp+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.redirect+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA.scapyi386+= execenv="jail" \ + execenv_jail_params="vnet allow.raw_sockets" ${PACKAGE}FILES+= exthdr.py \ mld.py \