193 lines
6.7 KiB
Python
193 lines
6.7 KiB
Python
# Copyright 2024 Volvo Car Corporation
|
|
# Licensed under Apache 2.0.
|
|
|
|
"""Unit test data for powertrain_build.zone_controller.composition_yaml."""
|
|
|
|
from test_data.zone_controller.test_composition_yaml import composition_yaml_setup
|
|
|
|
expected_result = {
|
|
"SoftwareComponents": {
|
|
"testName_SC": {
|
|
"type": "SWC",
|
|
"template": "ARTCSC",
|
|
"asil": "QM",
|
|
"secure": False,
|
|
"runnables": {
|
|
"AR_prefix_VcExtINI": {
|
|
"type": "INIT",
|
|
"accesses": composition_yaml_setup.base_accesses
|
|
},
|
|
"AR_prefix_testRunnable": {
|
|
"period": 10,
|
|
"type": "PERIODIC",
|
|
"accesses": composition_yaml_setup.base_accesses
|
|
},
|
|
},
|
|
"diagnostics": {},
|
|
"nv-needs": {},
|
|
"static": composition_yaml_setup.base_static,
|
|
"shared": composition_yaml_setup.base_shared,
|
|
"io": {
|
|
"DUMMY1": {
|
|
"DUMMY1": {
|
|
"dataElement": "DUMMY1",
|
|
"runnable": ["DummyRunnable"]
|
|
},
|
|
"PPortPrototype_IoHwAb_GetDUMMY1": {
|
|
"operation": "Op_IoHwAb_GetDUMMY1",
|
|
"runnable": ["DummyRunnable"],
|
|
"timeout": 0,
|
|
"calltype": "sync"
|
|
}
|
|
}
|
|
},
|
|
"ports": composition_yaml_setup.base_ports,
|
|
},
|
|
},
|
|
"DataTypes": composition_yaml_setup.base_data_types,
|
|
"PortInterfaces": composition_yaml_setup.base_port_interfaces,
|
|
"ExternalFiles": composition_yaml_setup.base_configuration
|
|
}
|
|
|
|
expected_extra_runnable_keys_result = {
|
|
"SoftwareComponents": {
|
|
"testName_SC": {
|
|
"type": "SWC",
|
|
"template": "ARTCSC",
|
|
"asil": "QM",
|
|
"secure": False,
|
|
"runnables": {
|
|
"AR_prefix_VcExtINI": {
|
|
"type": "INIT",
|
|
"accesses": composition_yaml_setup.base_accesses
|
|
},
|
|
"AR_prefix_testRunnable": {
|
|
"period": 10,
|
|
"type": "PERIODIC",
|
|
"accesses": composition_yaml_setup.base_accesses,
|
|
"mode_switch_points": ["DummyPort"]
|
|
},
|
|
},
|
|
"diagnostics": {},
|
|
"nv-needs": {},
|
|
"static": composition_yaml_setup.base_static,
|
|
"shared": composition_yaml_setup.base_shared,
|
|
"io": {
|
|
"DUMMY1": {
|
|
"DUMMY1": {
|
|
"dataElement": "DUMMY1",
|
|
"runnable": ["DummyRunnable"]
|
|
},
|
|
"PPortPrototype_IoHwAb_GetDUMMY1": {
|
|
"operation": "Op_IoHwAb_GetDUMMY1",
|
|
"runnable": ["DummyRunnable"],
|
|
"timeout": 0,
|
|
"calltype": "sync"
|
|
}
|
|
}
|
|
},
|
|
"ports": composition_yaml_setup.base_ports
|
|
}
|
|
},
|
|
"DataTypes": composition_yaml_setup.base_data_types,
|
|
"PortInterfaces": composition_yaml_setup.base_port_interfaces,
|
|
"ExternalFiles": composition_yaml_setup.base_configuration
|
|
}
|
|
|
|
expected_custom_names_result = {
|
|
"SoftwareComponents": {
|
|
"testName_SC": {
|
|
"type": "SWC",
|
|
"template": "ARTCSC",
|
|
"asil": "QM",
|
|
"secure": False,
|
|
"runnables": {
|
|
"dummy_init": {
|
|
"type": "INIT",
|
|
"accesses": composition_yaml_setup.base_accesses
|
|
},
|
|
"dummy_step": {
|
|
"period": 10,
|
|
"type": "PERIODIC",
|
|
"accesses": composition_yaml_setup.base_accesses
|
|
},
|
|
},
|
|
"diagnostics": {},
|
|
"nv-needs": {},
|
|
"static": composition_yaml_setup.base_static,
|
|
"shared": composition_yaml_setup.base_shared,
|
|
"io": {
|
|
"DUMMY1": {
|
|
"DUMMY1": {
|
|
"dataElement": "DUMMY1",
|
|
"runnable": ["DummyRunnable"]
|
|
},
|
|
"PPortPrototype_IoHwAb_GetDUMMY1": {
|
|
"operation": "Op_IoHwAb_GetDUMMY1",
|
|
"runnable": ["DummyRunnable"],
|
|
"timeout": 0,
|
|
"calltype": "sync"
|
|
}
|
|
}
|
|
},
|
|
"ports": composition_yaml_setup.base_ports,
|
|
}
|
|
},
|
|
"DataTypes": composition_yaml_setup.base_data_types,
|
|
"PortInterfaces": composition_yaml_setup.base_port_interfaces,
|
|
"ExternalFiles": composition_yaml_setup.base_configuration
|
|
}
|
|
|
|
expected_cal_result = {
|
|
"SoftwareComponents": {
|
|
"testName_SC": {
|
|
"type": "SWC",
|
|
"template": "ARTCSC",
|
|
"asil": "QM",
|
|
"secure": False,
|
|
"runnables": {
|
|
"AR_prefix_VcExtINI": {
|
|
"type": "INIT",
|
|
"accesses": composition_yaml_setup.cal_accesses
|
|
},
|
|
"AR_testName_SC_ZcCalibrationInit": {
|
|
"type": "INIT",
|
|
"accesses": composition_yaml_setup.cal_accesses
|
|
},
|
|
"AR_prefix_testRunnable": {
|
|
"period": 10,
|
|
"type": "PERIODIC",
|
|
"accesses": composition_yaml_setup.cal_accesses
|
|
},
|
|
"AR_testName_SC_ZcCalibrationStep": {
|
|
"period": 0.1,
|
|
"type": "PERIODIC",
|
|
"accesses": composition_yaml_setup.cal_accesses
|
|
}
|
|
},
|
|
"diagnostics": {},
|
|
"nv-needs": {},
|
|
"static": composition_yaml_setup.base_static,
|
|
"shared": composition_yaml_setup.cal_shared,
|
|
"io": {
|
|
"DUMMY1": {
|
|
"DUMMY1": {
|
|
"dataElement": "DUMMY1",
|
|
"runnable": ["DummyRunnable"]
|
|
},
|
|
"PPortPrototype_IoHwAb_GetDUMMY1": {
|
|
"operation": "Op_IoHwAb_GetDUMMY1",
|
|
"runnable": ["DummyRunnable"],
|
|
"timeout": 0,
|
|
"calltype": "sync"
|
|
}
|
|
}
|
|
},
|
|
"ports": composition_yaml_setup.base_ports,
|
|
}
|
|
},
|
|
"DataTypes": composition_yaml_setup.base_data_types,
|
|
"PortInterfaces": composition_yaml_setup.base_port_interfaces,
|
|
"ExternalFiles": composition_yaml_setup.base_configuration
|
|
}
|