shepherd-core 2023.10.3__py3-none-any.whl → 2023.12.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shepherd_core/__init__.py +1 -1
- shepherd_core/data_models/base/content.py +3 -8
- shepherd_core/data_models/base/shepherd.py +2 -6
- shepherd_core/data_models/content/virtual_source.py +13 -40
- shepherd_core/data_models/experiment/experiment.py +3 -8
- shepherd_core/data_models/experiment/observer_features.py +4 -9
- shepherd_core/data_models/experiment/target_config.py +4 -11
- shepherd_core/data_models/task/__init__.py +2 -6
- shepherd_core/data_models/task/emulation.py +7 -14
- shepherd_core/data_models/task/firmware_mod.py +1 -3
- shepherd_core/data_models/task/harvest.py +1 -3
- shepherd_core/data_models/testbed/cape_fixture.yaml +2 -1
- shepherd_core/data_models/testbed/observer.py +6 -22
- shepherd_core/data_models/testbed/observer_fixture.yaml +46 -16
- shepherd_core/data_models/testbed/target_fixture.yaml +18 -16
- shepherd_core/data_models/testbed/testbed.py +1 -3
- shepherd_core/data_models/testbed/testbed_fixture.yaml +2 -0
- shepherd_core/decoder_waveform/uart.py +8 -26
- shepherd_core/fw_tools/__init__.py +1 -3
- shepherd_core/fw_tools/converter.py +4 -12
- shepherd_core/fw_tools/patcher.py +4 -12
- shepherd_core/fw_tools/validation.py +2 -2
- shepherd_core/inventory/__init__.py +3 -9
- shepherd_core/inventory/python.py +7 -5
- shepherd_core/inventory/system.py +2 -5
- shepherd_core/logger.py +1 -3
- shepherd_core/reader.py +45 -41
- shepherd_core/testbed_client/client.py +5 -16
- shepherd_core/testbed_client/fixtures.py +4 -8
- shepherd_core/testbed_client/user_model.py +1 -3
- shepherd_core/vsource/virtual_converter_model.py +4 -14
- shepherd_core/vsource/virtual_harvester_model.py +1 -3
- shepherd_core/vsource/virtual_source_model.py +2 -6
- shepherd_core/writer.py +11 -22
- {shepherd_core-2023.10.3.dist-info → shepherd_core-2023.12.1.dist-info}/METADATA +16 -5
- {shepherd_core-2023.10.3.dist-info → shepherd_core-2023.12.1.dist-info}/RECORD +53 -53
- {shepherd_core-2023.10.3.dist-info → shepherd_core-2023.12.1.dist-info}/WHEEL +1 -1
- tests/conftest.py +32 -0
- tests/data_models/test_content_models.py +15 -9
- tests/data_models/test_experiment_models.py +2 -4
- tests/data_models/test_task_generation.py +1 -1
- tests/fw_tools/test_converter.py +11 -0
- tests/fw_tools/test_patcher.py +11 -4
- tests/fw_tools/test_validation.py +8 -0
- tests/inventory/test_inventory.py +1 -3
- tests/test_cal_hw.py +2 -6
- tests/test_examples.py +13 -2
- tests/test_writer.py +2 -2
- tests/vsource/conftest.py +1 -3
- tests/vsource/test_converter.py +2 -6
- tests/vsource/test_harvester.py +3 -9
- {shepherd_core-2023.10.3.dist-info → shepherd_core-2023.12.1.dist-info}/top_level.txt +0 -0
- {shepherd_core-2023.10.3.dist-info → shepherd_core-2023.12.1.dist-info}/zip-safe +0 -0
|
@@ -148,16 +148,12 @@ class Fixture:
|
|
|
148
148
|
def query_id(self, _id: int) -> dict:
|
|
149
149
|
if isinstance(_id, int) and _id in self.elements_by_id:
|
|
150
150
|
return self.elements_by_id[_id]
|
|
151
|
-
raise ValueError(
|
|
152
|
-
f"Initialization of {self.model_type} by ID failed - {_id} is unknown!"
|
|
153
|
-
)
|
|
151
|
+
raise ValueError(f"Initialization of {self.model_type} by ID failed - {_id} is unknown!")
|
|
154
152
|
|
|
155
153
|
def query_name(self, name: str) -> dict:
|
|
156
154
|
if isinstance(name, str) and name.lower() in self.elements_by_name:
|
|
157
155
|
return self.elements_by_name[name.lower()]
|
|
158
|
-
raise ValueError(
|
|
159
|
-
f"Initialization of {self.model_type} by name failed - {name} is unknown!"
|
|
160
|
-
)
|
|
156
|
+
raise ValueError(f"Initialization of {self.model_type} by name failed - {name} is unknown!")
|
|
161
157
|
|
|
162
158
|
|
|
163
159
|
def file_older_than(file: Path, delta: timedelta) -> bool:
|
|
@@ -172,7 +168,7 @@ class Fixtures:
|
|
|
172
168
|
suffix = ".yaml"
|
|
173
169
|
|
|
174
170
|
@validate_call
|
|
175
|
-
def __init__(self, file_path: Optional[Path] = None) -> None:
|
|
171
|
+
def __init__(self, file_path: Optional[Path] = None, *, reset: bool = False) -> None:
|
|
176
172
|
if file_path is None:
|
|
177
173
|
self.file_path = Path(__file__).parent.parent.resolve() / "data_models"
|
|
178
174
|
else:
|
|
@@ -180,7 +176,7 @@ class Fixtures:
|
|
|
180
176
|
self.components: Dict[str, Fixture] = {}
|
|
181
177
|
save_path = self.file_path / "fixtures.pickle"
|
|
182
178
|
|
|
183
|
-
if save_path.exists() and not file_older_than(save_path, timedelta(hours=24)):
|
|
179
|
+
if save_path.exists() and not file_older_than(save_path, timedelta(hours=24)) and not reset:
|
|
184
180
|
# speedup
|
|
185
181
|
with save_path.open("rb", buffering=-1) as fd:
|
|
186
182
|
self.components = pickle.load(fd) # noqa: S301
|
|
@@ -19,9 +19,7 @@ from ..data_models.base.shepherd import ShpModel
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
@validate_call
|
|
22
|
-
def hash_password(
|
|
23
|
-
pw: Annotated[str, StringConstraints(min_length=20, max_length=100)]
|
|
24
|
-
) -> bytes:
|
|
22
|
+
def hash_password(pw: Annotated[str, StringConstraints(min_length=20, max_length=100)]) -> bytes:
|
|
25
23
|
# TODO: add salt of testbed -> this fn should be part of Testbed-Object
|
|
26
24
|
# NOTE: 1M Iterations need 25s on beaglebone
|
|
27
25
|
return pbkdf2_hmac(
|
|
@@ -52,9 +52,7 @@ class VirtualConverterModel:
|
|
|
52
52
|
self.V_input_uV: float = 0.0
|
|
53
53
|
self.P_inp_fW: float = 0.0
|
|
54
54
|
self.P_out_fW: float = 0.0
|
|
55
|
-
self.interval_startup_disabled_drain_n: int =
|
|
56
|
-
self._cfg.interval_startup_delay_drain_n
|
|
57
|
-
)
|
|
55
|
+
self.interval_startup_disabled_drain_n: int = self._cfg.interval_startup_delay_drain_n
|
|
58
56
|
|
|
59
57
|
# container for the stored energy
|
|
60
58
|
self.V_mid_uV: float = self._cfg.V_intermediate_init_uV
|
|
@@ -71,12 +69,8 @@ class VirtualConverterModel:
|
|
|
71
69
|
|
|
72
70
|
# prepare hysteresis-thresholds
|
|
73
71
|
self.dV_enable_output_uV: float = self._cfg.dV_enable_output_uV
|
|
74
|
-
self.V_enable_output_threshold_uV: float =
|
|
75
|
-
|
|
76
|
-
)
|
|
77
|
-
self.V_disable_output_threshold_uV: float = (
|
|
78
|
-
self._cfg.V_disable_output_threshold_uV
|
|
79
|
-
)
|
|
72
|
+
self.V_enable_output_threshold_uV: float = self._cfg.V_enable_output_threshold_uV
|
|
73
|
+
self.V_disable_output_threshold_uV: float = self._cfg.V_disable_output_threshold_uV
|
|
80
74
|
|
|
81
75
|
if self.dV_enable_output_uV > self.V_enable_output_threshold_uV:
|
|
82
76
|
self.V_enable_output_threshold_uV = self.dV_enable_output_uV
|
|
@@ -163,11 +157,7 @@ class VirtualConverterModel:
|
|
|
163
157
|
|
|
164
158
|
if self.V_mid_uV > self._cfg.V_intermediate_max_uV:
|
|
165
159
|
self.V_mid_uV = self._cfg.V_intermediate_max_uV
|
|
166
|
-
if (
|
|
167
|
-
(not self.enable_boost)
|
|
168
|
-
and (self.P_inp_fW > 0.0)
|
|
169
|
-
and (self.V_mid_uV > self.V_input_uV)
|
|
170
|
-
):
|
|
160
|
+
if (not self.enable_boost) and (self.P_inp_fW > 0.0) and (self.V_mid_uV > self.V_input_uV):
|
|
171
161
|
# TODO: obfuscated - no "direct connection"?
|
|
172
162
|
self.V_mid_uV = self.V_input_uV
|
|
173
163
|
elif self.V_mid_uV < 1:
|
|
@@ -93,9 +93,7 @@ class VirtualHarvesterModel:
|
|
|
93
93
|
if distance_now < distance_last and distance_now < self.voltage_step_x4_uV:
|
|
94
94
|
self.voltage_hold = _voltage_uV
|
|
95
95
|
self.current_hold = _current_nA
|
|
96
|
-
elif
|
|
97
|
-
distance_last < distance_now and distance_last < self.voltage_step_x4_uV
|
|
98
|
-
):
|
|
96
|
+
elif distance_last < distance_now and distance_last < self.voltage_step_x4_uV:
|
|
99
97
|
self.voltage_hold = self.voltage_last
|
|
100
98
|
self.current_hold = self.current_last
|
|
101
99
|
|
|
@@ -37,9 +37,7 @@ class VirtualSourceModel:
|
|
|
37
37
|
cnv_config = ConverterPRUConfig.from_vsrc(
|
|
38
38
|
self.cfg_src, log_intermediate_node=log_intermediate
|
|
39
39
|
)
|
|
40
|
-
self.cnv: VirtualConverterModel = VirtualConverterModel(
|
|
41
|
-
cnv_config, self._cal_pru
|
|
42
|
-
)
|
|
40
|
+
self.cnv: VirtualConverterModel = VirtualConverterModel(cnv_config, self._cal_pru)
|
|
43
41
|
|
|
44
42
|
hrv_config = HarvesterPRUConfig.from_vhrv(
|
|
45
43
|
self.cfg_src.harvester,
|
|
@@ -53,9 +51,7 @@ class VirtualSourceModel:
|
|
|
53
51
|
self.W_inp_fWs: float = 0.0
|
|
54
52
|
self.W_out_fWs: float = 0.0
|
|
55
53
|
|
|
56
|
-
def iterate_sampling(
|
|
57
|
-
self, V_inp_uV: int = 0, I_inp_nA: int = 0, I_out_nA: int = 0
|
|
58
|
-
) -> int:
|
|
54
|
+
def iterate_sampling(self, V_inp_uV: int = 0, I_inp_nA: int = 0, I_out_nA: int = 0) -> int:
|
|
59
55
|
"""TEST-SIMPLIFICATION - code below is not part of pru-code,
|
|
60
56
|
but in part sample_emulator() in sampling.c
|
|
61
57
|
|
shepherd_core/writer.py
CHANGED
|
@@ -39,9 +39,7 @@ def path2str(
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def time2int(dumper: Dumper, data: timedelta) -> ScalarNode:
|
|
42
|
-
return dumper.represent_scalar(
|
|
43
|
-
"tag:yaml.org,2002:int", str(int(data.total_seconds()))
|
|
44
|
-
)
|
|
42
|
+
return dumper.represent_scalar("tag:yaml.org,2002:int", str(int(data.total_seconds())))
|
|
45
43
|
|
|
46
44
|
|
|
47
45
|
yaml.add_representer(pathlib.PosixPath, path2str, SafeDumper)
|
|
@@ -130,23 +128,20 @@ class Writer(Reader):
|
|
|
130
128
|
base_dir = file_path.resolve().parents[0]
|
|
131
129
|
self.file_path = unique_path(base_dir / file_path.stem, file_path.suffix)
|
|
132
130
|
self._logger.warning(
|
|
133
|
-
"File '%s' already exists ->
|
|
131
|
+
"File '%s' already exists -> storing under '%s' instead",
|
|
134
132
|
file_path,
|
|
135
133
|
self.file_path.name,
|
|
136
134
|
)
|
|
137
135
|
|
|
138
136
|
if isinstance(mode, str) and mode not in self.mode_dtype_dict:
|
|
139
|
-
raise ValueError(
|
|
140
|
-
f"Can't handle mode '{mode}' " f"(choose one of {self.mode_dtype_dict})"
|
|
141
|
-
)
|
|
137
|
+
raise ValueError(f"Can't handle mode '{mode}' (choose one of {self.mode_dtype_dict})")
|
|
142
138
|
|
|
143
139
|
_dtypes = self.mode_dtype_dict[mode if mode else self.mode_default]
|
|
144
140
|
if isinstance(datatype, str):
|
|
145
141
|
datatype = EnergyDType[datatype]
|
|
146
142
|
if isinstance(datatype, EnergyDType) and datatype not in _dtypes:
|
|
147
143
|
raise ValueError(
|
|
148
|
-
f"Can't handle value '{datatype}' of datatype "
|
|
149
|
-
f"(choose one of {_dtypes})"
|
|
144
|
+
f"Can't handle value '{datatype}' of datatype (choose one of {_dtypes})"
|
|
150
145
|
)
|
|
151
146
|
|
|
152
147
|
if self._modify:
|
|
@@ -158,9 +153,7 @@ class Writer(Reader):
|
|
|
158
153
|
self._datatype = (
|
|
159
154
|
datatype if isinstance(datatype, EnergyDType) else self.datatype_default
|
|
160
155
|
)
|
|
161
|
-
self._window_samples = (
|
|
162
|
-
window_samples if isinstance(window_samples, int) else 0
|
|
163
|
-
)
|
|
156
|
+
self._window_samples = window_samples if isinstance(window_samples, int) else 0
|
|
164
157
|
|
|
165
158
|
if isinstance(cal_data, (CalEmu, CalHrv)):
|
|
166
159
|
self._cal = CalSeries.from_cal(cal_data)
|
|
@@ -181,9 +174,7 @@ class Writer(Reader):
|
|
|
181
174
|
|
|
182
175
|
# show key parameters for h5-performance
|
|
183
176
|
settings = list(self.h5file.id.get_access_plist().get_cache())
|
|
184
|
-
self._logger.debug(
|
|
185
|
-
"H5Py Cache_setting=%s (_mdc, _nslots, _nbytes, _w0)", settings
|
|
186
|
-
)
|
|
177
|
+
self._logger.debug("H5Py Cache_setting=%s (_mdc, _nslots, _nbytes, _w0)", settings)
|
|
187
178
|
|
|
188
179
|
# Store the mode in order to allow user to differentiate harvesting vs emulation data
|
|
189
180
|
if isinstance(self._mode, str) and self._mode in self.mode_dtype_dict:
|
|
@@ -257,9 +248,7 @@ class Writer(Reader):
|
|
|
257
248
|
compression=self._compression,
|
|
258
249
|
)
|
|
259
250
|
grp_data["time"].attrs["unit"] = "s"
|
|
260
|
-
grp_data["time"].attrs[
|
|
261
|
-
"description"
|
|
262
|
-
] = "system time [s] = value * gain + (offset)"
|
|
251
|
+
grp_data["time"].attrs["description"] = "system time [s] = value * gain + (offset)"
|
|
263
252
|
|
|
264
253
|
grp_data.create_dataset(
|
|
265
254
|
"current",
|
|
@@ -309,7 +298,7 @@ class Writer(Reader):
|
|
|
309
298
|
else:
|
|
310
299
|
raise ValueError("timestamp-data was not usable")
|
|
311
300
|
|
|
312
|
-
len_old = self.
|
|
301
|
+
len_old = self.ds_voltage.shape[0]
|
|
313
302
|
|
|
314
303
|
# resize dataset
|
|
315
304
|
self.ds_time.resize((len_old + len_new,))
|
|
@@ -346,15 +335,15 @@ class Writer(Reader):
|
|
|
346
335
|
def _align(self) -> None:
|
|
347
336
|
"""Align datasets with buffer-size of shepherd"""
|
|
348
337
|
self._refresh_file_stats()
|
|
349
|
-
n_buff = self.
|
|
338
|
+
n_buff = self.ds_voltage.size / self.samples_per_buffer
|
|
350
339
|
size_new = int(math.floor(n_buff) * self.samples_per_buffer)
|
|
351
|
-
if size_new < self.
|
|
340
|
+
if size_new < self.ds_voltage.size:
|
|
352
341
|
if self.samplerate_sps != samplerate_sps_default:
|
|
353
342
|
self._logger.debug("skipped alignment due to altered samplerate")
|
|
354
343
|
return
|
|
355
344
|
self._logger.info(
|
|
356
345
|
"aligning with buffer-size, discarding last %d entries",
|
|
357
|
-
self.
|
|
346
|
+
self.ds_voltage.size - size_new,
|
|
358
347
|
)
|
|
359
348
|
self.ds_time.resize((size_new,))
|
|
360
349
|
self.ds_voltage.resize((size_new,))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: shepherd-core
|
|
3
|
-
Version: 2023.
|
|
3
|
+
Version: 2023.12.1
|
|
4
4
|
Summary: Programming- and CLI-Interface for the h5-dataformat of the Shepherd-Testbed
|
|
5
5
|
Home-page: https://pypi.org/project/shepherd-core/
|
|
6
6
|
Author: Ingmar Splitt, Kai Geissdoerfer
|
|
@@ -42,9 +42,6 @@ Requires-Dist: requests
|
|
|
42
42
|
Requires-Dist: pyelftools
|
|
43
43
|
Requires-Dist: zstandard
|
|
44
44
|
Provides-Extra: dev
|
|
45
|
-
Requires-Dist: black ; extra == 'dev'
|
|
46
|
-
Requires-Dist: pylint ; extra == 'dev'
|
|
47
|
-
Requires-Dist: flake8 ; extra == 'dev'
|
|
48
45
|
Requires-Dist: twine ; extra == 'dev'
|
|
49
46
|
Requires-Dist: pre-commit ; extra == 'dev'
|
|
50
47
|
Requires-Dist: pyright ; extra == 'dev'
|
|
@@ -64,7 +61,7 @@ Requires-Dist: coverage ; extra == 'test'
|
|
|
64
61
|
[](https://pypi.org/project/shepherd_core)
|
|
65
62
|
[](https://pypi.python.org/pypi/shepherd-core)
|
|
66
63
|
[](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml)
|
|
67
|
-
[](https://github.com/astral-sh/ruff)
|
|
68
65
|
|
|
69
66
|
**Documentation**: <https://orgua.github.io/shepherd/external/shepherd_core.html>
|
|
70
67
|
|
|
@@ -93,6 +90,20 @@ For postprocessing shepherds .h5-files users want to use [shepherd_data](https:/
|
|
|
93
90
|
|
|
94
91
|
See [examples](https://github.com/orgua/shepherd-datalib/tree/main/shepherd_core/examples) for more details and usage. Most functionality is showcased there. The [extra](https://github.com/orgua/shepherd-datalib/tree/main/shepherd_core/extra)-directory holds data-generators relevant for the testbed. Notably is a trafficbench-experiment that's used to derive the link-matrix.
|
|
95
92
|
|
|
93
|
+
### Compatibility
|
|
94
|
+
|
|
95
|
+
| OS | PyVersion | Comment |
|
|
96
|
+
|---------|--------------|--------------------------------------------|
|
|
97
|
+
| Ubuntu | 3.8 - 3.12 | |
|
|
98
|
+
| Windows | 3.8 - 3.12 | no support for elf and hex-conversions yet |
|
|
99
|
+
| MacOS | 3.8 - 3.12 | hex-conversion missing |
|
|
100
|
+
|
|
101
|
+
Notes:
|
|
102
|
+
- hex-conversion needs a working and accessible objcopy
|
|
103
|
+
- elf-supports needs
|
|
104
|
+
- ``shepherd-core[elf]`` installs ``pwntools-elf-only``
|
|
105
|
+
- most elf-features also still utilize hex-conversion
|
|
106
|
+
|
|
96
107
|
### Data-Models in Detail
|
|
97
108
|
|
|
98
109
|
- new orchestration ``/data-models`` with focus on remote shepherd-testbed
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
shepherd_core/__init__.py,sha256=
|
|
1
|
+
shepherd_core/__init__.py,sha256=M5Zl1foAX-m7EVEVTgv9PtIY00FwE0CopdFfmhLEBeE,1347
|
|
2
2
|
shepherd_core/calibration_hw_def.py,sha256=VBPgekKtoA6xc5pLOADGdAIuJUNz5kdDf3pm3A13F0U,2158
|
|
3
3
|
shepherd_core/commons.py,sha256=8HLrOq30Zrgh0AcrtakJYyu3hwMgQks7mF7JyaBMcdw,170
|
|
4
|
-
shepherd_core/logger.py,sha256=
|
|
5
|
-
shepherd_core/reader.py,sha256=
|
|
6
|
-
shepherd_core/writer.py,sha256=
|
|
4
|
+
shepherd_core/logger.py,sha256=mIJQ5eCpamsCnc_R7qoceYVXe8JM4-YZriqfzvTt9Yk,1656
|
|
5
|
+
shepherd_core/reader.py,sha256=mjBNWnDfsbTxlzhfPJYfcZdySCPO4K1Ub098T8RI0rI,26064
|
|
6
|
+
shepherd_core/writer.py,sha256=hnaC7Jy82lQDln-3ZXWLdmXUO1mgD8s16K89lBbKCew,14352
|
|
7
7
|
shepherd_core/data_models/__init__.py,sha256=mem0m4nZY3EgG1ctBdGGGt128lhmglF9a4e5w9OGJu0,1651
|
|
8
8
|
shepherd_core/data_models/doc_virtual_source.py,sha256=KizMcfGKj7BnHIbaJHT7KeTF01SV__UXv01qV_DGHSs,6057
|
|
9
9
|
shepherd_core/data_models/base/__init__.py,sha256=ugVEWXfYRCmK4o94RG4N_GKR7AbBQLfn5PCbEKVpZMU,44
|
|
10
10
|
shepherd_core/data_models/base/cal_measurement.py,sha256=ZlSnHXOiY--AzQ1-g0BnU7I4g9sMDqF3g52jsl5IHDY,2873
|
|
11
11
|
shepherd_core/data_models/base/calibration.py,sha256=5Xn5p9uNaOw9mdO1ZsulpMP0rwDIMcJPf5-Cp5CnRq0,9709
|
|
12
|
-
shepherd_core/data_models/base/content.py,sha256=
|
|
13
|
-
shepherd_core/data_models/base/shepherd.py,sha256=
|
|
12
|
+
shepherd_core/data_models/base/content.py,sha256=4k3D14m6h681QQjJFsG7Xgr4R64d21JEWKJWOnVVVck,1925
|
|
13
|
+
shepherd_core/data_models/base/shepherd.py,sha256=5kQNZdhF53u9S4wLadbm_73mB9VTzgHyrm6LG_KheWc,5748
|
|
14
14
|
shepherd_core/data_models/base/timezone.py,sha256=OBzPPfrD__z1aTO7qlVWD1uD8eZFJ6CoDLac_mTrYCg,443
|
|
15
15
|
shepherd_core/data_models/base/wrapper.py,sha256=mzAMdX9-BeSAeTzlWKFnjj3v2wV6NJgaSHULFHEiWes,600
|
|
16
16
|
shepherd_core/data_models/content/__init__.py,sha256=JLj2zzjDeyqLrz9KiWDMW1shCeJjj676zjcXj8ly10Y,545
|
|
@@ -21,58 +21,58 @@ shepherd_core/data_models/content/firmware.py,sha256=cuh8tURI39ZzTF-wuh4ofsNfRC1
|
|
|
21
21
|
shepherd_core/data_models/content/firmware_datatype.py,sha256=WHVJu-LIP_snjeITIKkuZo7aIapoTIZeFXkUNqyEqy8,154
|
|
22
22
|
shepherd_core/data_models/content/virtual_harvester.py,sha256=5obXW17uBkQdfyPnpJHoSZmlIBUefoDGmFLYrxUSmOA,9268
|
|
23
23
|
shepherd_core/data_models/content/virtual_harvester_fixture.yaml,sha256=UWlXq-7lsyhHAkrKkyEHWdJ0fIlyy_jwSV9O_hVE2nY,4294
|
|
24
|
-
shepherd_core/data_models/content/virtual_source.py,sha256=
|
|
24
|
+
shepherd_core/data_models/content/virtual_source.py,sha256=0CucbyBh-r5I4UJNJayW9fKNwb6dI97iaE5MLYxrZMc,13960
|
|
25
25
|
shepherd_core/data_models/content/virtual_source_fixture.yaml,sha256=2PsWP3-xad5TycZ-OQn23WsJdYwq7_9_foC4wBFYmK0,10443
|
|
26
26
|
shepherd_core/data_models/experiment/__init__.py,sha256=DX9kylCe8zFm4PpVT8YS4csip7-MDoSrdah3nhBdiJE,651
|
|
27
|
-
shepherd_core/data_models/experiment/experiment.py,sha256=
|
|
28
|
-
shepherd_core/data_models/experiment/observer_features.py,sha256=
|
|
29
|
-
shepherd_core/data_models/experiment/target_config.py,sha256=
|
|
30
|
-
shepherd_core/data_models/task/__init__.py,sha256=
|
|
31
|
-
shepherd_core/data_models/task/emulation.py,sha256=
|
|
32
|
-
shepherd_core/data_models/task/firmware_mod.py,sha256=
|
|
33
|
-
shepherd_core/data_models/task/harvest.py,sha256=
|
|
27
|
+
shepherd_core/data_models/experiment/experiment.py,sha256=LY0uIaFGAzPta0fbCy-gSxlUe90ztZdc4CqVwzc_mIU,3971
|
|
28
|
+
shepherd_core/data_models/experiment/observer_features.py,sha256=chK9PJ3KCS_jfd28GAfM73V-EI2c1WJM1cAAS20nIj0,4984
|
|
29
|
+
shepherd_core/data_models/experiment/target_config.py,sha256=IBWxf3yVF5dUBi7mS5mJXfN1rL2S7QYhu_4IL6u6Yig,3532
|
|
30
|
+
shepherd_core/data_models/task/__init__.py,sha256=g0l4dtIgTPKhfFvnClJrCm3zLFiZpBVbbQ2f4gzdwK0,3180
|
|
31
|
+
shepherd_core/data_models/task/emulation.py,sha256=HE7L3GWKdsAkUPgvdDHxYJG92GNodP9CUEtKgQJghjA,6221
|
|
32
|
+
shepherd_core/data_models/task/firmware_mod.py,sha256=8uXMFVk3Z96gUW0gVY95VeUx-YtZnMc2yw3paC5S5Mw,2730
|
|
33
|
+
shepherd_core/data_models/task/harvest.py,sha256=QcNJjgixiq70NogdcYXwpj91_6Jl7s7CaAnEw_xEWck,3254
|
|
34
34
|
shepherd_core/data_models/task/observer_tasks.py,sha256=cwFBdoUESE5zcOuky35lmd6uKFaQkGiW8kNFHir1z1g,3380
|
|
35
35
|
shepherd_core/data_models/task/programming.py,sha256=uO6IZR8wb0N3791QgAZE7AF0CB7XoyOkFBiDH395IvE,2244
|
|
36
36
|
shepherd_core/data_models/task/testbed_tasks.py,sha256=W8ElhxOjNrTFG9A1WKGrjhNnyLxmvJgM06DwLyBbayQ,1771
|
|
37
37
|
shepherd_core/data_models/testbed/__init__.py,sha256=kQG0EUqJ5ylGRuwYZTbppWue9zDcSytpsHtUnohbGgA,566
|
|
38
38
|
shepherd_core/data_models/testbed/cape.py,sha256=Y9QDQcJ76IFPMVgiIw5pFztDd1y7RUiDhrsjVqHj6jM,1154
|
|
39
|
-
shepherd_core/data_models/testbed/cape_fixture.yaml,sha256=
|
|
39
|
+
shepherd_core/data_models/testbed/cape_fixture.yaml,sha256=uwZxe6hsqvofn5tzg4sffjbVtTVUkextL1GCri_z2A4,2197
|
|
40
40
|
shepherd_core/data_models/testbed/gpio.py,sha256=pzgRpo9QXL2lyqeov_o1Sr3_5r4T8NS7-Q6rOYnbVR4,2100
|
|
41
41
|
shepherd_core/data_models/testbed/gpio_fixture.yaml,sha256=yXvoXAau2hancKi2yg1xIkErPWQa6gIxNUG3y8JuF9Y,3076
|
|
42
42
|
shepherd_core/data_models/testbed/mcu.py,sha256=JHVVOYkhvhwYG5z5nUXdiVVXVcRNrAfqefaS56E4RWM,1301
|
|
43
43
|
shepherd_core/data_models/testbed/mcu_fixture.yaml,sha256=lRZMLs27cTeERSFGkbMt5xgxbn11Gh9G1mQqOZK136I,522
|
|
44
|
-
shepherd_core/data_models/testbed/observer.py,sha256=
|
|
45
|
-
shepherd_core/data_models/testbed/observer_fixture.yaml,sha256=
|
|
44
|
+
shepherd_core/data_models/testbed/observer.py,sha256=hivbfME16o-M7LwBto4hvNA9X_prGgs0FdH39cve4Mo,3110
|
|
45
|
+
shepherd_core/data_models/testbed/observer_fixture.yaml,sha256=f6UjGFCsMlqtgfsThd_BfwcgpjI3LB4oPt_GNwBHWRI,4806
|
|
46
46
|
shepherd_core/data_models/testbed/target.py,sha256=wIjeqXlYkDv24S1iSswyLrpSWsI_J78MnmNVk2KGpT0,1776
|
|
47
|
-
shepherd_core/data_models/testbed/target_fixture.yaml,sha256=
|
|
48
|
-
shepherd_core/data_models/testbed/testbed.py,sha256=
|
|
49
|
-
shepherd_core/data_models/testbed/testbed_fixture.yaml,sha256=
|
|
47
|
+
shepherd_core/data_models/testbed/target_fixture.yaml,sha256=rgWCwCpPXzaEoUzMDxkb7dgH-4gW2qffUuAC78JkNQk,3667
|
|
48
|
+
shepherd_core/data_models/testbed/testbed.py,sha256=RY_YHwWuZdMWzZB5mYwgborycvnCrNdMyFB5Ou2Zrek,3274
|
|
49
|
+
shepherd_core/data_models/testbed/testbed_fixture.yaml,sha256=9i2cmYRrHOHTJG9zp40h8h0LgO9DdrCJz8tyGdiQCzc,714
|
|
50
50
|
shepherd_core/decoder_waveform/__init__.py,sha256=HEdjRcm3m4ySEXpJ_D3lZqnxiuobJqC8axZAaAHBwDk,43
|
|
51
|
-
shepherd_core/decoder_waveform/uart.py,sha256=
|
|
52
|
-
shepherd_core/fw_tools/__init__.py,sha256=
|
|
53
|
-
shepherd_core/fw_tools/converter.py,sha256=
|
|
51
|
+
shepherd_core/decoder_waveform/uart.py,sha256=EumQv4wTWDvz4-0vhFx9vCI0PLDsOFmSU9473TxmH_M,10671
|
|
52
|
+
shepherd_core/fw_tools/__init__.py,sha256=9W-MXU5j3iJ8AgRzoGUaljD0bN29jh8LtY-pyj5HWbY,2071
|
|
53
|
+
shepherd_core/fw_tools/converter.py,sha256=2g0CZBZLn-CfUTpJljghf8AEpjIt4X7Q1FoCTsmx3A0,3273
|
|
54
54
|
shepherd_core/fw_tools/converter_elf.py,sha256=SEkrPuYUsr1VICDlZiZzr0B1njWcl9mW3J_oZk32Sb4,1008
|
|
55
|
-
shepherd_core/fw_tools/patcher.py,sha256=
|
|
56
|
-
shepherd_core/fw_tools/validation.py,sha256=
|
|
57
|
-
shepherd_core/inventory/__init__.py,sha256=
|
|
58
|
-
shepherd_core/inventory/python.py,sha256=
|
|
59
|
-
shepherd_core/inventory/system.py,sha256=
|
|
55
|
+
shepherd_core/fw_tools/patcher.py,sha256=nXgYKGQjcEE4IYd8yNl4-t5kjlB43iFdp24oYlEaras,3774
|
|
56
|
+
shepherd_core/fw_tools/validation.py,sha256=aVfMiv8gX6rWOtj9IIAEiqh6APH2_DNWwueSyPJztro,4262
|
|
57
|
+
shepherd_core/inventory/__init__.py,sha256=0qkTGMMuHUOg5sn4gNOB8XcKhF75fTC7DzRh9aN4soQ,1856
|
|
58
|
+
shepherd_core/inventory/python.py,sha256=Ar_M4cmmQgViY4caU5XH9Iye5X3jNFDnJiWGaZwNpo4,1168
|
|
59
|
+
shepherd_core/inventory/system.py,sha256=Mmd5TieS3mnPSF2L_HSpjdA7mbTe8Wquduz28OJjD1Q,1930
|
|
60
60
|
shepherd_core/inventory/target.py,sha256=XywiKmDpYKIBQt1Jo_k3bJeCOKxnzy5ob_9PYdFrjGE,421
|
|
61
61
|
shepherd_core/testbed_client/__init__.py,sha256=V38uxXOhwB8tlAjR0jH1MPSWB1LltwC0g8ipwaIyC9o,103
|
|
62
|
-
shepherd_core/testbed_client/client.py,sha256=
|
|
63
|
-
shepherd_core/testbed_client/fixtures.py,sha256=
|
|
64
|
-
shepherd_core/testbed_client/user_model.py,sha256=
|
|
62
|
+
shepherd_core/testbed_client/client.py,sha256=geqj1brDvzsAtriDFSyLCAHZfMPKwch8TSpLHw5sLXM,5785
|
|
63
|
+
shepherd_core/testbed_client/fixtures.py,sha256=W-lTy5y4wPYfOBVGotRVxLAt72jCNTWqC_kePe06xys,9078
|
|
64
|
+
shepherd_core/testbed_client/user_model.py,sha256=MU_k6j_c_Y6JILDcu9iN2kNERoxS4UwaGuj5dlnlUqo,1978
|
|
65
65
|
shepherd_core/vsource/__init__.py,sha256=x84_0M8Dg8R7DLKE5zyNAAGFiuOHPehDOWPt2KeBhKw,344
|
|
66
|
-
shepherd_core/vsource/virtual_converter_model.py,sha256=
|
|
67
|
-
shepherd_core/vsource/virtual_harvester_model.py,sha256=
|
|
68
|
-
shepherd_core/vsource/virtual_source_model.py,sha256=
|
|
66
|
+
shepherd_core/vsource/virtual_converter_model.py,sha256=gT-eKQCcroc2EIzSa2O9HGArsM_JKhx2CKJjuKUyiak,10331
|
|
67
|
+
shepherd_core/vsource/virtual_harvester_model.py,sha256=tlt_Emi7bGbqeo0Cb7f2rt2K07whEB7r1RXdTJncGyI,7763
|
|
68
|
+
shepherd_core/vsource/virtual_source_model.py,sha256=LiprQZmcfRBfliiDedr_RxEtrPYxcGWrUrqBM76zqCQ,2723
|
|
69
69
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
-
tests/conftest.py,sha256=
|
|
71
|
-
tests/test_cal_hw.py,sha256=
|
|
72
|
-
tests/test_examples.py,sha256=
|
|
70
|
+
tests/conftest.py,sha256=6S4xE1rsqMjZlZ7ItzipGcuggUQk04DZBCta2vEOdGI,1856
|
|
71
|
+
tests/test_cal_hw.py,sha256=fECEm1QAtpxjLIqboljEr0UVG6neGS_-uJ-rgZrMkFg,1243
|
|
72
|
+
tests/test_examples.py,sha256=RPuIOzhuMmWk8GPggiv12sGGHZ0TzjVfUDU7GERzOeM,888
|
|
73
73
|
tests/test_logger.py,sha256=aW9Et1juBSyQmpEBhn1sdN4k18XOkzGxdByhgTGZGZk,432
|
|
74
74
|
tests/test_reader.py,sha256=6Q5Yfpsnlonm3nT8PWc6dY41Vn7APCLateeO5InZBXI,9560
|
|
75
|
-
tests/test_writer.py,sha256=
|
|
75
|
+
tests/test_writer.py,sha256=MvKlX5ANUI-0XlAnPn39VbBRQy_vGE3ggc4OJj7stO0,5323
|
|
76
76
|
tests/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
77
|
tests/data_models/conftest.py,sha256=thBKAL1LsphEC5g4yQG-3U1jNr_HGFe0F0rDLAJZJ54,368
|
|
78
78
|
tests/data_models/example_cal_data.yaml,sha256=61QrTWjvvI3phIoZsKKiw02thYPjZeY51a302Bl-wk4,785
|
|
@@ -88,10 +88,10 @@ tests/data_models/example_config_testbed.yaml,sha256=ubN9dfvrMPxHQuWpqw_JkNHTxc4
|
|
|
88
88
|
tests/data_models/example_config_virtsource.yaml,sha256=zB9nGys728SzUrR4tO-e8ebr1vP8-Bgg7TsKISDnGrk,4415
|
|
89
89
|
tests/data_models/test_base_models.py,sha256=QysiTWlxiD3vvHZNuQVm-Fpu1QyfnnqRHysh0FKOrcw,6755
|
|
90
90
|
tests/data_models/test_content_fixtures.py,sha256=rfYIEYzxWGBD6YYQQoJyCk2qbj_BAPnFZhOoL86SgYk,1701
|
|
91
|
-
tests/data_models/test_content_models.py,sha256=
|
|
91
|
+
tests/data_models/test_content_models.py,sha256=NZMg1VqGEfs_V0_4LcQTlARfBbUOGflvp_SGyh8Urv0,8058
|
|
92
92
|
tests/data_models/test_examples.py,sha256=yiiPZCjFQ4oBZCiIGmR3XOyU9qEAiFqncmO33LbbPNU,1420
|
|
93
|
-
tests/data_models/test_experiment_models.py,sha256=
|
|
94
|
-
tests/data_models/test_task_generation.py,sha256=
|
|
93
|
+
tests/data_models/test_experiment_models.py,sha256=1imFOh7_zFCYlihsj6VP_9tlKYXGelSKmsZAqwAh0LA,9184
|
|
94
|
+
tests/data_models/test_task_generation.py,sha256=xsGMb_KjhqFTogr5IkAax4CPBz4VfvgxjYgUtLMM-1E,1905
|
|
95
95
|
tests/data_models/test_task_models.py,sha256=Ii673kTZjqpj8ly1fJ_qp43XWL3KEHzKBwKO_oAYvn4,3575
|
|
96
96
|
tests/data_models/test_testbed_fixtures.py,sha256=k5hxz5vgx-LkKDxJptOUdrCZFwpEp8h2cK1HyY_5reA,1419
|
|
97
97
|
tests/data_models/test_testbed_models.py,sha256=WSVZQIEvA7nOUx8w9v-gxqEjt9Sh_0zG6J0yr2Bts9k,4573
|
|
@@ -99,19 +99,19 @@ tests/decoder_waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
99
99
|
tests/decoder_waveform/test_decoder.py,sha256=g6Es5G2BDORfaQsn-YIjMudd3URiHwYBtc8zHdz0EiE,894
|
|
100
100
|
tests/fw_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
101
|
tests/fw_tools/conftest.py,sha256=gaEjO9M883G6NG7UHYfyudPAeoSjDncQpOcPJ4qmor8,151
|
|
102
|
-
tests/fw_tools/test_converter.py,sha256
|
|
103
|
-
tests/fw_tools/test_patcher.py,sha256=
|
|
104
|
-
tests/fw_tools/test_validation.py,sha256=
|
|
102
|
+
tests/fw_tools/test_converter.py,sha256=-jbAOjoad1KC6Za5S8AMs2CGJgmLSSijAV7dlraqQ9o,2215
|
|
103
|
+
tests/fw_tools/test_patcher.py,sha256=LmMG5XKoV9vjjFbgo2SSnckz6WfuO6HtJEXdu545Zv4,2109
|
|
104
|
+
tests/fw_tools/test_validation.py,sha256=769IIbnzljWnjZuZYb3HaVDTlXziSZDORLZVxnrzK2E,1893
|
|
105
105
|
tests/inventory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
|
-
tests/inventory/test_inventory.py,sha256=
|
|
106
|
+
tests/inventory/test_inventory.py,sha256=rw7NNHEJIT9W3G-N1SgqtwUO_o3EvHfSrbf9e3bRJLs,612
|
|
107
107
|
tests/testbed_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
tests/vsource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
|
-
tests/vsource/conftest.py,sha256=
|
|
110
|
-
tests/vsource/test_converter.py,sha256=
|
|
111
|
-
tests/vsource/test_harvester.py,sha256
|
|
109
|
+
tests/vsource/conftest.py,sha256=57KUTh9NtZ_1OZ1YWY8JzwPDMH3KcdHSFaIYzvL7HyY,1387
|
|
110
|
+
tests/vsource/test_converter.py,sha256=vDbhLuMbN6oAv9DRhFIl-SUQC9BlghMTHCR5KhP6sgY,5075
|
|
111
|
+
tests/vsource/test_harvester.py,sha256=hx8Nfd4SIJ7-bcrd2tpT_nb7O7-ZUSuqYMA7Eo69j3s,2442
|
|
112
112
|
tests/vsource/test_z.py,sha256=H9LlNsAq3nV5PPaoM8yP4FLnPhdJJSoLSmUOD5rtobM,90
|
|
113
|
-
shepherd_core-2023.
|
|
114
|
-
shepherd_core-2023.
|
|
115
|
-
shepherd_core-2023.
|
|
116
|
-
shepherd_core-2023.
|
|
117
|
-
shepherd_core-2023.
|
|
113
|
+
shepherd_core-2023.12.1.dist-info/METADATA,sha256=zX8uiU5P39bWwiau2V_7AD1dqs7B6N8Pbsy4qvedCn4,7029
|
|
114
|
+
shepherd_core-2023.12.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
115
|
+
shepherd_core-2023.12.1.dist-info/top_level.txt,sha256=6H9zsX2PNWwILI7EJu8fNam1KfG2Sqvkez-jlwrD9SE,20
|
|
116
|
+
shepherd_core-2023.12.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
117
|
+
shepherd_core-2023.12.1.dist-info/RECORD,,
|
tests/conftest.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import subprocess
|
|
1
2
|
from pathlib import Path
|
|
3
|
+
from typing import Iterable # py38, later use: from collections.abc import Iterable
|
|
2
4
|
|
|
3
5
|
import numpy as np
|
|
4
6
|
import pytest
|
|
@@ -30,3 +32,33 @@ def generate_h5_file(file_path: Path, file_name: str = "harvest_example.h5") ->
|
|
|
30
32
|
@pytest.fixture
|
|
31
33
|
def data_h5(tmp_path: Path) -> Path:
|
|
32
34
|
return generate_h5_file(tmp_path)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def pytest_collection_modifyitems(
|
|
38
|
+
config: pytest.Config,
|
|
39
|
+
items: Iterable[pytest.Item],
|
|
40
|
+
) -> None:
|
|
41
|
+
# ELF
|
|
42
|
+
try:
|
|
43
|
+
from pwnlib.elf import ELF
|
|
44
|
+
except ImportError:
|
|
45
|
+
ELF = None
|
|
46
|
+
skip_elf = pytest.mark.skip(
|
|
47
|
+
reason="ELF-support not found -> shepherd_core[elf] missing or OS is Windows?"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# OBJCOPY
|
|
51
|
+
try:
|
|
52
|
+
subprocess.run(["objcopy", "--version"], check=True)
|
|
53
|
+
OBJCOPY = True
|
|
54
|
+
except FileNotFoundError:
|
|
55
|
+
OBJCOPY = None
|
|
56
|
+
skip_converter = pytest.mark.skip(
|
|
57
|
+
reason="Objcopy not found -> are binutils or build-essential installed?"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
for item in items:
|
|
61
|
+
if "elf" in item.keywords and ELF is None:
|
|
62
|
+
item.add_marker(skip_elf)
|
|
63
|
+
if "converter" in item.keywords and OBJCOPY is None:
|
|
64
|
+
item.add_marker(skip_converter)
|
|
@@ -55,6 +55,8 @@ def test_content_model_fw_faulty() -> None:
|
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
@pytest.mark.elf
|
|
59
|
+
@pytest.mark.converter
|
|
58
60
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
59
61
|
def test_content_model_fw_min(path_elf: Path, tmp_path: Path) -> None:
|
|
60
62
|
path_hex = (tmp_path / (path_elf.stem + ".hex")).resolve()
|
|
@@ -70,6 +72,8 @@ def test_content_model_fw_min(path_elf: Path, tmp_path: Path) -> None:
|
|
|
70
72
|
)
|
|
71
73
|
|
|
72
74
|
|
|
75
|
+
@pytest.mark.elf
|
|
76
|
+
@pytest.mark.converter
|
|
73
77
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
74
78
|
def test_content_model_fw_from_elf(path_elf: Path) -> None:
|
|
75
79
|
Firmware.from_firmware(
|
|
@@ -80,6 +84,8 @@ def test_content_model_fw_from_elf(path_elf: Path) -> None:
|
|
|
80
84
|
)
|
|
81
85
|
|
|
82
86
|
|
|
87
|
+
@pytest.mark.elf
|
|
88
|
+
@pytest.mark.converter
|
|
83
89
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
84
90
|
def test_content_model_fw_from_hex(path_elf: Path, tmp_path: Path) -> None:
|
|
85
91
|
path_hex = (tmp_path / (path_elf.stem + ".hex")).resolve()
|
|
@@ -105,6 +111,8 @@ def test_content_model_fw_from_hex_failing(tmp_path: Path) -> None:
|
|
|
105
111
|
)
|
|
106
112
|
|
|
107
113
|
|
|
114
|
+
@pytest.mark.elf
|
|
115
|
+
@pytest.mark.converter
|
|
108
116
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
109
117
|
def test_content_model_fw_extract_elf_to_dir(path_elf: Path, tmp_path: Path) -> None:
|
|
110
118
|
fw = Firmware.from_firmware(
|
|
@@ -118,6 +126,8 @@ def test_content_model_fw_extract_elf_to_dir(path_elf: Path, tmp_path: Path) ->
|
|
|
118
126
|
assert file.is_file()
|
|
119
127
|
|
|
120
128
|
|
|
129
|
+
@pytest.mark.elf
|
|
130
|
+
@pytest.mark.converter
|
|
121
131
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
122
132
|
def test_content_model_fw_extract_hex_to_dir(path_elf: Path, tmp_path: Path) -> None:
|
|
123
133
|
path_hex = (tmp_path / (path_elf.stem + ".hex")).resolve()
|
|
@@ -134,9 +144,7 @@ def test_content_model_fw_extract_hex_to_dir(path_elf: Path, tmp_path: Path) ->
|
|
|
134
144
|
|
|
135
145
|
|
|
136
146
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
137
|
-
def test_content_model_fw_extract_path_elf_to_dir(
|
|
138
|
-
path_elf: Path, tmp_path: Path
|
|
139
|
-
) -> None:
|
|
147
|
+
def test_content_model_fw_extract_path_elf_to_dir(path_elf: Path, tmp_path: Path) -> None:
|
|
140
148
|
assert path_elf.exists()
|
|
141
149
|
fw = Firmware(
|
|
142
150
|
data=path_elf,
|
|
@@ -151,10 +159,10 @@ def test_content_model_fw_extract_path_elf_to_dir(
|
|
|
151
159
|
assert file.is_file()
|
|
152
160
|
|
|
153
161
|
|
|
162
|
+
@pytest.mark.elf
|
|
163
|
+
@pytest.mark.converter
|
|
154
164
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
155
|
-
def test_content_model_fw_extract_path_hex_to_dir(
|
|
156
|
-
path_elf: Path, tmp_path: Path
|
|
157
|
-
) -> None:
|
|
165
|
+
def test_content_model_fw_extract_path_hex_to_dir(path_elf: Path, tmp_path: Path) -> None:
|
|
158
166
|
path_hex = (tmp_path / (path_elf.stem + ".hex")).resolve()
|
|
159
167
|
path_hex = fw_tools.elf_to_hex(path_elf, path_hex)
|
|
160
168
|
assert path_hex.exists()
|
|
@@ -213,9 +221,7 @@ def test_content_model_hrv_faulty_voltage0() -> None:
|
|
|
213
221
|
|
|
214
222
|
def test_content_model_hrv_faulty_voltage1() -> None:
|
|
215
223
|
with pytest.raises(ValueError):
|
|
216
|
-
_ = VirtualHarvesterConfig(
|
|
217
|
-
name="iv110", voltage_min_mV=4001, voltage_max_mV=4000
|
|
218
|
-
)
|
|
224
|
+
_ = VirtualHarvesterConfig(name="iv110", voltage_min_mV=4001, voltage_max_mV=4000)
|
|
219
225
|
|
|
220
226
|
|
|
221
227
|
def test_content_model_hrv_faulty_voltage2() -> None:
|
|
@@ -46,7 +46,7 @@ def test_experiment_model_exp_yaml_comparison() -> None:
|
|
|
46
46
|
|
|
47
47
|
target_cfgs = TargetConfig(
|
|
48
48
|
target_IDs=list(range(1, 5)),
|
|
49
|
-
custom_IDs=list(range(
|
|
49
|
+
custom_IDs=list(range(4)),
|
|
50
50
|
energy_env={"name": "SolarSunny"},
|
|
51
51
|
virtual_source={"name": "diode+capacitor"},
|
|
52
52
|
firmware1={"name": "nrf52_demo_rf"},
|
|
@@ -148,9 +148,7 @@ def test_experiment_model_exp_missing_target() -> None:
|
|
|
148
148
|
target_IDs=[1234567], # <- not existent
|
|
149
149
|
custom_IDs=list(range(7, 18)),
|
|
150
150
|
energy_env=EnergyEnvironment(name="ThermoelectricWashingMachine"),
|
|
151
|
-
virtual_source=VirtualSourceConfig(
|
|
152
|
-
name="BQ25570-Schmitt", harvester=hrv
|
|
153
|
-
),
|
|
151
|
+
virtual_source=VirtualSourceConfig(name="BQ25570-Schmitt", harvester=hrv),
|
|
154
152
|
firmware1=Firmware(name="nrf52_demo_rf"),
|
|
155
153
|
firmware2=Firmware(name="msp430_deep_sleep"),
|
|
156
154
|
),
|
|
@@ -25,7 +25,7 @@ def test_task_generation_script(tmp_path: Path) -> None:
|
|
|
25
25
|
# first init similar to yaml
|
|
26
26
|
TargetConfig(
|
|
27
27
|
target_IDs=list(range(1, 4)),
|
|
28
|
-
custom_IDs=list(range(
|
|
28
|
+
custom_IDs=list(range(3)),
|
|
29
29
|
energy_env={"name": "SolarSunny"},
|
|
30
30
|
virtual_source={"name": "diode+capacitor"},
|
|
31
31
|
firmware1={"name": "nrf52_demo_rf"},
|
tests/fw_tools/test_converter.py
CHANGED
|
@@ -14,6 +14,7 @@ def path_hex(tmp_path: Path) -> Path:
|
|
|
14
14
|
return fw_tools.elf_to_hex(path_elf, path_hex)
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
@pytest.mark.converter
|
|
17
18
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
18
19
|
def test_elf_to_hex(path_elf: Path, tmp_path: Path) -> None:
|
|
19
20
|
path_hex = (tmp_path / (path_elf.stem + ".hex")).resolve()
|
|
@@ -22,6 +23,8 @@ def test_elf_to_hex(path_elf: Path, tmp_path: Path) -> None:
|
|
|
22
23
|
assert path_hex.as_posix() == path_gen.as_posix()
|
|
23
24
|
|
|
24
25
|
|
|
26
|
+
@pytest.mark.elf
|
|
27
|
+
@pytest.mark.converter
|
|
25
28
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
26
29
|
def test_firmware_to_hex_w_elf(path_elf: Path) -> None:
|
|
27
30
|
path_gen = fw_tools.firmware_to_hex(path_elf)
|
|
@@ -29,6 +32,8 @@ def test_firmware_to_hex_w_elf(path_elf: Path) -> None:
|
|
|
29
32
|
assert path_gen.suffix.lower() == ".hex"
|
|
30
33
|
|
|
31
34
|
|
|
35
|
+
@pytest.mark.elf
|
|
36
|
+
@pytest.mark.converter
|
|
32
37
|
def test_firmware_to_hex_w_hex(path_hex: Path) -> None:
|
|
33
38
|
path_gen = fw_tools.firmware_to_hex(path_hex)
|
|
34
39
|
assert path_gen.exists
|
|
@@ -36,12 +41,16 @@ def test_firmware_to_hex_w_hex(path_hex: Path) -> None:
|
|
|
36
41
|
assert path_gen.as_posix() == path_hex.as_posix()
|
|
37
42
|
|
|
38
43
|
|
|
44
|
+
@pytest.mark.elf
|
|
45
|
+
@pytest.mark.converter
|
|
39
46
|
def test_firmware_to_hex_w_fail() -> None:
|
|
40
47
|
path_some = Path(__file__).parent / "conftest.py"
|
|
41
48
|
with pytest.raises(ValueError):
|
|
42
49
|
_ = fw_tools.firmware_to_hex(path_some)
|
|
43
50
|
|
|
44
51
|
|
|
52
|
+
@pytest.mark.elf
|
|
53
|
+
@pytest.mark.converter
|
|
45
54
|
def test_hash() -> None:
|
|
46
55
|
hash_a = fw_tools.file_to_hash(files_elf[0])
|
|
47
56
|
hash_b = fw_tools.file_to_hash(files_elf[1])
|
|
@@ -50,6 +59,8 @@ def test_hash() -> None:
|
|
|
50
59
|
assert hash_b == hash_c
|
|
51
60
|
|
|
52
61
|
|
|
62
|
+
@pytest.mark.elf
|
|
63
|
+
@pytest.mark.converter
|
|
53
64
|
@pytest.mark.parametrize("path_elf", files_elf)
|
|
54
65
|
def test_base64(path_elf: Path, tmp_path: Path) -> None:
|
|
55
66
|
b64_a = fw_tools.file_to_base64(path_elf)
|