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:
aas_test_engines check_file test.aasx
aas_test_engines check_file test.json --format json
aas_test_engines check_server https://localhost https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002
aas_test_engines generate_files output_dir
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.dump()
Check JSON:
from aas_test_engines import file
with open('aas.json') as f:
result = file.check_json_file(f)
aas = {
'assetAdministrationShells': [],
'submodels': [],
'conceptDescriptions': []
}
result = file.check_json_data(aas)
result.dump()
Check XML:
from aas_test_engines import file
from xml.etree import ElementTree
with open('aas.xml') as f:
result = file.check_xml_file(f)
data = ElementTree.fromstring(
'<environment xmlns="https://admin-shell.io/aas/3/0" />')
result = file.check_xml_data(aas)
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.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)