Skip to main content

Official test tooling for the Asset Administration Shell

Project description

Test Engines for the Asset Administration Shell

Tests

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 aas_test_engines

Check AAS Type 1 (File)

Check AASX:

from aas_test_engines import file
from xml.etree import ElementTree

with open('aas.aasx') as f:
    file.check_aasx_file(f)

Check JSON:

from aas_test_engines import file

# Check file
with open('aas.json') as f:
    file.check_json_file(f)

# Or check data directly
aas = {
    'assetAdministrationShells': [],
    'submodels': [],
    'conceptDescriptions': []
}
file.check_json_data(aas)

Check XML:

from aas_test_engines import file
from xml.etree import ElementTree

# Check file
with open('aas.xml') as f:
    file.check_xml_file(f)

# Or check data directly
data = ElementTree.fromstring(
    '<environment xmlns="https://admin-shell.io/aas/3/0" />')
file.check_xml_data(aas)

Checking older versions

By default, the file.check... methods check compliance to version 3.0 of the standard. You may want to check against older versions by passing a string containing the version to these methods.

You can query the list of supported versions as follows:

from aas_test_engines import file

print(file.supported_versions())
print(file.latest_version())

Check AAS Type 2 (HTTP API)

Check a running server instance

from aas_test_engines import api

tests = api.generate_tests()

# Check an instance
api.execute_tests(tests, "http://localhost")

# Check another instance
api.execute_tests(tests, "http://localhost:3000")

Checking older versions and specific test suites

By default, the api.generate_tests method generate test cases for version 3.0 of the standard and all associated test suites. You may want to check against older versions by passing a string containing the version to these methods. You can also provide a list of test suites to check against:

from aas_test_engines import api

tests = api.generate_tests('1.0RC03', ['repository'])
api.execute_tests(tests, "http://localhost")

You can query the list of supported versions and their associated test suites as follows:

from aas_test_engines import api

print(api.supported_versions())
print(api.latest_version())

For version 1.0RC03 the following test suites are available:

API Name Test Suite Read Test Suite Read and Write
Asset Administration Shell API aas_read aas
Submodel API submodel_read submodel
AASX File Server API aasx_read aasx
Asset Administration Shell Registry API aas_registry_read aas_registry
Submodel Registry API submodel_registry_read submodel_registry
Asset Administration Shell Repository API aas_repository_read aas_repository
Submodel Repository API submodel_repository_read submodel_repository
Concept Description Repository API concept_description_repository_read concept_description_repository
Asset Administration Shell Basic Discovery API aas_discovery_read aas_discvoery
Serialization API serialization -
Description API description -

Command line interface

You may want to invoke the test tools using the simplified command line interface:

# Check file
python -m aas_test_engines file test.aasx

# Check server
python -m aas_test_engines api https://localhost --suite registry

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

aas_test_engines-0.2.tar.gz (50.2 kB view hashes)

Uploaded Source

Built Distribution

aas_test_engines-0.2-py3-none-any.whl (53.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page