8686 ' ros__parameters:\n '
8787 ' str_param: Override\n '
8888)
89+ INPUT_NS_NODE_OVERLAY_PARAMETER_FILE = (
90+ f'{ TEST_NAMESPACE } :\n '
91+ f' { TEST_NODE } :\n '
92+ ' ros__parameters:\n '
93+ ' str_param: Override\n '
94+ )
8995
9096# Skip cli tests on Windows while they exhibit pathological behavior
9197# https://github.com/ros2/build_farmer/issues/248
@@ -317,7 +323,7 @@ def test_verb_load_wildcard(self):
317323 assert param_load_command .wait_for_shutdown (timeout = TEST_TIMEOUT )
318324 assert param_load_command .exit_code != launch_testing .asserts .EXIT_OK
319325 assert launch_testing .tools .expect_output (
320- expected_lines = ['Param file does not contain selected parameters' ],
326+ expected_lines = ['Param file does not contain any valid parameters' ],
321327 text = param_load_command .output ,
322328 strict = False
323329 )
@@ -343,7 +349,7 @@ def test_verb_load_wildcard(self):
343349 assert params ['str_param' ] == 'Wildcard'
344350 assert params ['int_param' ] == 12345
345351
346- # Concatenate wildcard + some overlays
352+ # Concatenate wildcard + some overlays with absolute node name
347353 filepath = self ._write_param_file (tmpdir , 'params.yaml' ,
348354 INPUT_WILDCARD_PARAMETER_FILE + '\n ' +
349355 INPUT_NODE_OVERLAY_PARAMETER_FILE )
@@ -363,3 +369,24 @@ def test_verb_load_wildcard(self):
363369 params = loaded_params [f'{ TEST_NAMESPACE } /{ TEST_NODE } ' ]['ros__parameters' ]
364370 assert params ['str_param' ] == 'Override' # Overriden
365371 assert params ['int_param' ] == 12345 # Wildcard namespace
372+
373+ # Concatenate wildcard + some overlays with namespace and base node name
374+ filepath = self ._write_param_file (tmpdir , 'params.yaml' ,
375+ INPUT_WILDCARD_PARAMETER_FILE + '\n ' +
376+ INPUT_NS_NODE_OVERLAY_PARAMETER_FILE )
377+ with self .launch_param_load_command (
378+ arguments = [f'{ TEST_NAMESPACE } /{ TEST_NODE } ' , filepath ]
379+ ) as param_load_command :
380+ assert param_load_command .wait_for_shutdown (timeout = TEST_TIMEOUT )
381+ assert param_load_command .exit_code == launch_testing .asserts .EXIT_OK
382+
383+ # Dump and check that wildcard parameters were overriden if in node namespace
384+ with self .launch_param_dump_command (
385+ arguments = [f'{ TEST_NAMESPACE } /{ TEST_NODE } ' ]
386+ ) as param_dump_command :
387+ assert param_dump_command .wait_for_shutdown (timeout = TEST_TIMEOUT )
388+ assert param_dump_command .exit_code == launch_testing .asserts .EXIT_OK
389+ loaded_params = yaml .safe_load (param_dump_command .output )
390+ params = loaded_params [f'{ TEST_NAMESPACE } /{ TEST_NODE } ' ]['ros__parameters' ]
391+ assert params ['str_param' ] == 'Override' # Overriden
392+ assert params ['int_param' ] == 12345 # Wildcard namespace
0 commit comments