admin-shell-io / aas-test-engines

Official test tooling for the Asset Administration Shell
https://certification.admin-shell-io.com
Apache License 2.0
5 stars 2 forks source link

AASX files not being validated against schema #12

Closed juileetikekar closed 1 month ago

juileetikekar commented 2 months ago

While validating the invalid AASX file via test-engine (check_aasx_file method), the engine does not generate any error, the validation is successful. However, the JSON serialized format of the same file results into errors as expected.

Excpected result: The JSON and AASX file validation should generate the same output.

Additional Information: Based on the source code, the schema validation might be missing in the "check_aasx_data" method.

AASX and JSON files being used: test.zip

otto-ifak commented 2 months ago

Your aasx file uses the wrong relationships. This is a bug in the package explorer, see https://github.com/admin-shell-io/aas-test-engines/issues/2.

Please use the following file (rename to .aasx) which contains the correct relationships: test_correct.zip

juileetikekar commented 2 months ago

Hi @otto-ifak,

Thank you for the response !

In my opinion, the test engine should report the error in case of wrong relationships.

As mentioned in the reported issue, it does not report any error.

otto-ifak commented 2 months ago

@juileetikekar I would disagree with this: The underlying OPC format allows users to place whatever they want in the container, for example arbitrary JSON and XML files. How could we distinguish these from the actual AAS? The only option is to rely on the relationship and therefore we only check the JSON/XML files with the exactly correct relationship. Otherwise we would assume all JSON/XML files in the container file to be an AAS which would lead to many false errors.

sebbader-sap commented 1 month ago

So the engine didn't find the AAS XML file, therefore were was no error detected, therefore there was no error reported, right? How about giving a warning (e.g. "Warn: No AAS file detected!") is such cases?

otto-ifak commented 1 month ago

Yes, you are right. Giving a warning is a good idea.

otto-ifak commented 1 month ago

In case the aas origin is missing:

Checking AASX package
   Checking [Content_Types].xml
   Checking relationships
      Checking root relationship
   Checking files
      WARN: Expected exactly one aas origin, but found 0

In case the aas origin is present but has no aas-spec relationship:

Checking AASX package
   Checking [Content_Types].xml
   Checking relationships
      Checking root relationship
         Relationship aasx/aasx-origin is of type http://admin-shell.io/aasx/relationships/aasx-origin
         Checking relationships of aasx/aasx-origin
   Checking files
      WARN: No aas spec found