-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] fix potential backbone name conflict when running cert suite #10596
[test] fix potential backbone name conflict when running cert suite #10596
Conversation
…LOGY when running cert suite, multiple tests are running in parallel, the extract backbone name is allocated by cert suite script based on PORT_OFFSET. For example, if PORT_OFFSET is 10, the default backbone network name is "backbone10". This commit targets to defineing multiple backbone networks inside a single tests. For examples, in test_multi_ail.py, if PORT_OFFSET is 10, then "backbone10.0" and "backbone10.1" are created. Also, then subnet prefix of the network format is chagnes to: backbone10.0 -> 9100:0::0/64 (9100::0/64) backbone10.1 -> 9100:1::0/64
BACKBONE_IPV6_ADDR_START is originally defined as the interger which value is the sum of 0x9100 and PORT_OFFSET This commit define BACKBONE_IPV6_ADDR_START as the string value.
Size Report of OpenThread
|
fa1c54d
to
da500fd
Compare
Introduce new member `_backbone_network_names`, it's a list to store all the backbone network names, for example ["backbone0.0", "backbone0.1"]
da500fd
to
ac738f9
Compare
…ork_name() per comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some small suggestions.
702b8f5
to
52baf80
Compare
Thanks Handa Wang!
@Irving-cl @superwhd @bukepo This PR is ready to be reviewed, please kindly take a look, thank! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Left a nonblocking minor question.
@@ -500,9 +520,6 @@ def _parse_params(self, params: Optional[dict]) -> dict: | |||
assert params.get('version', '') == '', params | |||
params['version'] = '' | |||
|
|||
# set default backbone network for bbr/otbr/host if not specified | |||
params.setdefault('backbone_network', config.BACKBONE_DOCKER_NETWORK_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping this line to ensure it will never be None, which can simply the _construct_backbone_network_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backbone_network_id
is None
for non otbr/host nodes by design in this PR. It can be strange (though no harm) to assign a default backbone network id for a non-BR node. Any thoughts?
d41ecb0
to
4a6c216
Compare
Hi @jwhui , this PR is ready to be merged as a single commit, thanks! |
background
#10550 has introduced a new way to support multiple backbone nework in otbr docker test. Though it works good while running a single test, a bug exists when running cert-suite, which runs a batch of tests in parallel.
cert-suite allocates the name of the backbone interfaces dynamically by setting env PORT_OFFSET for each test, so there is potentially conflict exists if we hard code the
backbone_network
name in TOPOLOGY. This PR is targeting to fix this potential naming conflict.how to fix
We fix it by assigning a number for
backbone_network_id
in each BR definition in TOPOLOGY, instead of setting a fixedbackbone network
name. The final backbone network name is decided by bothPORT_OFFSET
env and the number ofbackbone_network
(inbackbone{PORT_OFFSET}.{backbone_network}
format)For example, if
PORT_OFFSET
is 0 andbackbone_network_id
is 1, then backbone network name will bebackbone0.1
. For the tests that only use one backbone network and thebackbone_network_id
is not given, the backbone network name is by defaultbackbone{PORT_OFFSET}.0
.New test case format
<backbone-id>
is any integer from 0, for each BR inside a single test, if<backbone-id>
is different, the BR use different backbone interfaces; the same<backbone-id>
inside a single test case means the same backbone network interface.'backbone_network_id': <backbone-id>
is optional for single backbone test cases, when it's not given while defining a otbr node, the backbone is default asbackbone{PORT_OFFSET}.0
.For developers, if you are defining a new test which has multiple backbone interfaces, please ensure
backbone_network_id
is explicitly defined in each BR, otherwize an error is reported.