Official test tooling for the Asset Administration Shell
Project description
Test Engines for the Asset Administration Shell
The Asset Administration Shell (AAS) is a standard for Digital Twins. More information can be found here.
The tools in this repository offer measures to validate compliance of AAS implementations against the AAS standard.
Installation
You can install the AAS Test Engines via pip:
python -m pip install --upgrade aas_test_engines
Command Line Interface
You may want to invoke the test tools using the simplified command line interface:
# Check file
aas_test_engines check_file test.aasx
aas_test_engines check_file test.json --format json
# Check server
aas_test_engines check_server https://localhost https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002
# Generate test data
aas_test_engines generate_files output_dir
# Alternative output formats
aas_test_engines check_file test.aasx --output html > output.html
aas_test_engines check_file test.aasx --output json > output.json
Supported Versions and Suites
By default, the Test Engines test against the latest version 3.0 (file and api). For v3.0 api testing, the following suites are defined:
Asset Administration Shell API
Submodel API
Serialization API
AASX File Server API
Asset Administration Shell Registry API
Submodel Registry API
Asset Administration Shell Repository API
Submodel Repository API
Concept Description Repository API
Asset Administration Shell Basic Discovery API
Description API
Asset Administration Shell Service Specification
Submodel Service Specification
AASX File Server Service Specification
Asset Administration Shell Registry Service Specification
Submodel Registry Service Specification
Discovery Service Specification
Asset Administration Shell Repository Service Specification
Submodel Repository Service Specification
ConceptDescription Repository Service Specification
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-003
https://admin-shell.io/aas/API/3/0/AasxFileServerServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/DiscoveryServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-001
https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-002
https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-003
https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-004
https://admin-shell.io/aas/API/3/0/ConceptDescriptionRepositoryServiceSpecification/SSP-001
Python Module Interface
Check AAS Type 1 (File)
Check AASX:
from aas_test_engines import file
with open('aas.aasx', 'rb') as f:
result = file.check_aasx_file(f)
# result.ok() == True
result.dump()
# try result.to_html() to get an interactive representation
Check JSON:
from aas_test_engines import file
# Check file
with open('aas.json') as f:
result = file.check_json_file(f)
# result.ok() == True
# Or check data directly
aas = {
'assetAdministrationShells': [],
'submodels': [],
'conceptDescriptions': []
}
result = file.check_json_data(aas)
# result.ok() == True
result.dump()
Check XML:
from aas_test_engines import file
from xml.etree import ElementTree
# Check file
with open('aas.xml') as f:
result = file.check_xml_file(f)
# result.ok() == True
# Or check data directly
data = ElementTree.fromstring(
'<environment xmlns="https://admin-shell.io/aas/3/0" />')
result = file.check_xml_data(aas)
# result.ok() == True
result.dump()
Checking older versions:
from aas_test_engines import file
print(file.supported_versions())
print(file.latest_version())
with open('aas.aasx', 'rb') as f:
result = file.check_aasx_file(f, version="3.0")
# result.ok() == True
result.dump()
Check AAS Type 2 (HTTP API)
Check a running server instance:
from aas_test_engines import api
result = api.execute_tests("http://localhost", "https://localhost https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002")
result.dump()
Checking older versions:
from aas_test_engines import api
print(api.supported_versions())
print(api.latest_version())
result = api.execute_tests("http://localhost", 'Asset Administration Shell API', version="3.0")
result.dump()
Generating test data for software testing
If you develop an AAS application like an AAS editor you may want to use test data to verify correctness of your application. The test engines allow to generate a set of AAS files which are compliant with the standard and you can therefore use to assess your application as follows:
from aas_test_engines import file
for is_valid, sample in file.generate():
print(sample) # or whatever you want to do with it
Project details
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
File details
Details for the file aas_test_engines-1.0.0.tar.gz
.
File metadata
- Download URL: aas_test_engines-1.0.0.tar.gz
- Upload date:
- Size: 79.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35330378ae6c3c03cc24d260aea9f32055ff292310e9896785aa90c53c6de66a |
|
MD5 | cf0193c94fda2076bde5dcfb88112d8b |
|
BLAKE2b-256 | bba73163b5c4a77518f454d7471de829a6d3fcc1e38823ea68d4e2302f048de7 |
File details
Details for the file aas_test_engines-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: aas_test_engines-1.0.0-py3-none-any.whl
- Upload date:
- Size: 82.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c4c406686526be278d7796d1ea7e8c22cdc68bd2df4317d12fc81aa9da7cbc |
|
MD5 | 25a99871f285e667dcfbf48b7145d55a |
|
BLAKE2b-256 | b8ae670795db6d998e0bedc0ffd98073d2a924683881f7e38222be429eb7b9d0 |