twister bsim harness: Fix for hwmv2 platfrom names

The new hwmv2 platform names have "/" and "@" in
their names, we need to replace those with "_".
Otherwise the harness will produce a FileNotFoundError
exception when trying to create the executable.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-03-21 17:42:21 +01:00 committed by Carles Cufí
parent 6b621a2939
commit 11e9c71059

View file

@ -706,9 +706,10 @@ class Bsim(Harness):
new_exe_name = f'bs_{self.instance.platform.name}_{new_exe_name}'
else:
new_exe_name = self.instance.name
new_exe_name = new_exe_name.replace(os.path.sep, '_').replace('.', '_')
new_exe_name = f'bs_{new_exe_name}'
new_exe_name = new_exe_name.replace(os.path.sep, '_').replace('.', '_').replace('@', '_')
new_exe_path: str = os.path.join(bsim_out_path, 'bin', new_exe_name)
logger.debug(f'Copying executable from {original_exe_path} to {new_exe_path}')
shutil.copy(original_exe_path, new_exe_path)