scripts: twister: config_parser: copy common values

Create copys of the common configuration values when constructing test
scenarios, to avoid mutating the common value with test specific
appends.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2023-11-11 14:52:21 +10:00 committed by Carles Cufí
commit 31200fb33d

View file

@ -3,6 +3,7 @@
# Copyright (c) 2018-2022 Intel Corporation # Copyright (c) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
import copy
import scl import scl
import warnings import warnings
from typing import Union from typing import Union
@ -176,7 +177,8 @@ class TwisterConfigParser:
{"CONF_FILE", "OVERLAY_CONFIG", "DTC_OVERLAY_FILE"}, v {"CONF_FILE", "OVERLAY_CONFIG", "DTC_OVERLAY_FILE"}, v
) )
else: else:
d[k] = v # Copy common value to avoid mutating it with test specific values below
d[k] = copy.copy(v)
for k, v in self.scenarios[name].items(): for k, v in self.scenarios[name].items():
if k == "extra_args": if k == "extra_args":