Python wrapper for SDCcc test tool
Project description
pysdccc
This python packages provides a convenient way to execute the SDCcc test suite.
This wrapper is only compatible with SDCcc versions later than internal-baseline-001.
Installation
Download from pypi using pip install pysdccc. There is also an option to use this via the command line by installing pysdccc[cli].
Development
For this open source project the Contributor License Agreement governs all relevant activities and your contributions. By contributing to the project you agree to be bound by this Agreement and to licence your work accordingly.
- clone the repository
- install dependencies, e.g. with
uv sync --dev
Usage
Quick start
import pysdccc
async def main():
if not await pysdccc.is_downloaded("my-specific-version"):
await pysdccc.download("https://url/to/sdccc.zip")
runner = pysdccc.SdcccRunner("/path/to/sdccc/result/directory")
# https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes
return_code, direct_result, invariant_result = await runner.run(
config="/path/to/configuration/file.toml",
requirements="/path/to/requirements/file.toml",
)
if direct_result is None or invariant_result is None:
print("No result file available")
return
for test_case in direct_result + invariant_result:
print(f"{test_case.test_identifier}: {test_case.is_passed}")
If you look for a synchronous version. Please note this is deprecated. The async methods are the preferred way.
import pysdccc
def main():
if not pysdccc.is_downloaded_sync("my-specific-version").result():
pysdccc.download_sync("https://url/to/sdccc.zip").result()
runner = pysdccc.SdcccRunnerSync("/path/to/sdccc/result/directory")
# https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes
return_code, direct_result, invariant_result = runner.run(
config="/path/to/configuration/file.toml",
requirements="/path/to/requirements/file.toml",
).result(timeout=60) # use .result(timeout=...) to wait for the result in a synchronous way
# checkout example from above ...
Create configuration file
Configure the test consumer. Check the test consumer configuration for more information.
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
config = {
'SDCcc': {
... # add all relevant config parameter
}
}
config_path = anyio.Path('/path/to/configuration/file.toml')
await config_path.write_text(toml.dumps(config))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
await runner.run(config=config_path, requirements='/path/to/requirements/file.toml')
# or if you have already downloaded SDCcc
config = await runner.get_config() # load default configuration
config['SDCcc']['Consumer']['DeviceEpr'] = "urn:uuid:12345678-1234-1234-1234-123456789012" # e.g. change device epr
# save and run as above
Create requirements file
Enable or disable specific requirements. Check the test requirements for more information.
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
requirements = {
# the standard name is the key, the requirement from the standard is the value
'BICEPS': {
... # add all requirements to be tested
}
}
requirements_path = anyio.Path('/path/to/requirement/file.toml')
await requirements_path.write_text(toml.dumps(requirements))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
# optionally, check whether you did not add a requirement that is not available
await runner.check_requirements(requirements_path)
await runner.run('/path/to/configuration/file.toml', requirements=requirements_path)
# or, if you have already downloaded SDCcc
requirements = await runner.get_requirements() # load default configuration
requirements['BICEPS']['R0033'] = False # e.g. disable biceps R0033
# save and run as above
Create test parameter configuration
Some tests require individual parameters. Check the test parameter configuration for more information.
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
testparameter_config = {
'TestParameter': {
...
}
}
testparameter_config_path = anyio.Path('/path/to/test_parameter/file.toml')
await testparameter_config_path.write_text(toml.dumps(testparameter_config))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
await runner.run(
config='/path/to/configuration/file.toml',
requirements='/path/to/requirements/file.toml',
testparam=testparameter_config_path,
)
# or, if you have already downloaded SDCcc
testparameter_config = await runner.get_test_parameter() # load default configuration
testparameter_config['TestParameter']['Biceps547TimeInterval'] = 10
# save and run as above
Logging
The SDCcc runner provides a logger called pysdccc.run that can be used to log messages during the execution of the tests. Stdout is mapped to logging level info and stderr to error.
Be aware that no further processing of the SDCcc process output is done. Depending on the format you use you may get duplicated timestamps, etc. Also, it might happen that a java error can stretch over multiple lines, which may result in multiple log messages in python for the same java error.
Execute SDCcc from command-line interface (cli)
There exists a cli wrapper for the SDCcc executable. If pysdccc[cli] is installed, sdccc can be used to execute arbitrary SDCcc commands, e.g. sdccc --version. More information can be found here.
Also, you can manually install and uninstall sdccc versions using the cli, e.g. uv run pysdccc install https://url/to/sdccc.zip or from a local path uv run pysdccc install path/to/sdccc.zip.
Notices
pysdccc is not intended for use in medical products, clinical trials, clinical studies, or in clinical routine.
ISO 9001
pysdccc was not developed according to ISO 9001.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysdccc-1.1.0.tar.gz.
File metadata
- Download URL: pysdccc-1.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2005e4e91a148331191bb301164f20df4fee218c972ea1258c32d0835e48a827
|
|
| MD5 |
64408dac557aa95f33eeac0e516f93d3
|
|
| BLAKE2b-256 |
a44442a536bf490e65678c6933a2af472e015a600aa6df88ed63228ffa2e9b7f
|
Provenance
The following attestation bundles were made for pysdccc-1.1.0.tar.gz:
Publisher:
publish.yml on Draegerwerk/pysdccc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysdccc-1.1.0.tar.gz -
Subject digest:
2005e4e91a148331191bb301164f20df4fee218c972ea1258c32d0835e48a827 - Sigstore transparency entry: 1074646847
- Sigstore integration time:
-
Permalink:
Draegerwerk/pysdccc@369499358adc54d04377da32a273d66c947f1750 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Draegerwerk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@369499358adc54d04377da32a273d66c947f1750 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysdccc-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pysdccc-1.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8315ef03e780947ec5db765cccaede0f15b0545106992a8692b80e2c0fefc034
|
|
| MD5 |
bf4954ca8f544297d44e6fa77f5f0cb2
|
|
| BLAKE2b-256 |
83bc982b3b60df0d511bb8d2f873d888ebe0883339e9424186a05cdd0f3aa3f4
|
Provenance
The following attestation bundles were made for pysdccc-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on Draegerwerk/pysdccc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysdccc-1.1.0-py3-none-any.whl -
Subject digest:
8315ef03e780947ec5db765cccaede0f15b0545106992a8692b80e2c0fefc034 - Sigstore transparency entry: 1074646853
- Sigstore integration time:
-
Permalink:
Draegerwerk/pysdccc@369499358adc54d04377da32a273d66c947f1750 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Draegerwerk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@369499358adc54d04377da32a273d66c947f1750 -
Trigger Event:
push
-
Statement type: