Skip to content

Add integration tests for LoLa/mw::com feature in ITF#21

Draft
Subramanian-K812 wants to merge 9 commits into
mainfrom
Subramanian-K812_add_communication_feature_integration_tests
Draft

Add integration tests for LoLa/mw::com feature in ITF#21
Subramanian-K812 wants to merge 9 commits into
mainfrom
Subramanian-K812_add_communication_feature_integration_tests

Conversation

@Subramanian-K812

Copy link
Copy Markdown

Add communication (LoLa / mw::com) integration tests to ITF

Summary

Adds an ITF test suite for the communication module (LoLa / mw::com) that
exercises the deployed ipc_bridge example on the target image as two real OS
processes communicating over shared memory. The tests assert on the data the
consumer actually observes — sample sequence and per-sample hash validity —
rather than on log strings the application prints about its own configuration,
so a regression in the middleware is what breaks them.

The suite runs under the existing //feature_integration_tests/itf:itf
target on both the Linux (Docker) and QNX (QEMU) configs

What's added

File Purpose
feature_integration_tests/itf/test_communication.py The test cases (see coverage table below).
feature_integration_tests/itf/comm_helpers.py Producer/consumer exchange helpers and output oracles (CommResult, ordering/hash checks, deployment-config and ACL scenario helpers).
feature_integration_tests/itf/test_properties.py Fallback-safe wrapper around attribute_plugin.add_test_properties, mirroring feature_integration_tests/test_cases/test_properties.py.
feature_integration_tests/itf/BUILD Adds the new sources to the itf target and activates the requirement-traceability plugin (-p attribute_plugin + @score_tooling//python_basics/score_pytest:attribute_plugin dep).

Test coverage

Test Verifies (requirement IDs) Oracle
test_ipc_bridge_is_deployed — (deployment smoke check) Binary present on the target image.
test_event_exchange_delivers_valid_data event_type, producer_consumer, interfaces, time_based_arch, service_discovery Consumer discovers the service, exits cleanly, confirms ≥1 hash-valid cycle, no hash mismatch.
test_received_samples_are_ordered_and_uncorrupted data_corruption, data_reordering Every sample's FNV-1a hash matches; received cycle numbers are non-decreasing.
test_late_joining_consumer_receives_cached_data stateless_communication, producer_consumer A consumer subscribing well after the producer started still binds and receives valid cached samples.
test_deployment_config_is_read_from_runtime_path depl_config_runtime, multi_binding_depl SHM binding / service identity are read at runtime from an explicit -s <path> manifest, not compiled in.
test_missing_config_file_fails_deterministically depl_config_runtime Missing manifest → deterministic fast failure, no hang, no silent success, never reaches discovery.
test_truncated_config_fails_deterministically depl_config_runtime Syntactically invalid JSON → same deterministic-failure contract.
test_schema_invalid_config_fails_deterministically depl_config_runtime Well-formed JSON missing required schema structure → same contract.
test_mixed_criticality_acl_isolation safe_communication, asil, data_corruption, data_reordering ASIL-B provider offers to one allowed UID; a concurrently-running excluded UID is denied and cannot affect the allowed consumer's stream. (Runs on Linux; skipped on QNX — see Limitations.)

Requirement IDs are the published feat_req__com__* identifiers, attached via
@add_test_properties(partially_verifies=[...]) so they are emitted into the
JUnit XML <properties> — the same traceability convention used by the
persistency FIT cases under feature_integration_tests/test_cases.

Deliberately skipped tests

These document real, observed behaviour of the current vehicle/example rather
than hiding gaps:

  • test_service_discovery_is_order_independent — starting the consumer before
    the provider races the provider's shared-memory setup with this vehicle;
    proxy construction / first-sample reads intermittently fail. Service
    discovery is still exercised on every run by
    test_event_exchange_delivers_valid_data.
  • test_generic_skeleton_interoperates_with_typed_proxy — the generic
    skeleton delivers its first sample twice, tripping the receiver's
    ordering/count check; the typed skeleton is unaffected.
  • test_mixed_criticality_acl_isolation on QNX only — see Limitations.

Limitations

  • ASIL-B ACL isolation on QNX. allowedConsumer enforcement is a
    shared-memory ACL keyed on the consumer's real UID, so exercising it needs a
    consumer running under a UID excluded from the allow-list. On QNX, LoLa's
    MessagePassingService endpoint registration itself requires privilege, so
    a consumer launched under a lower-privilege UID (on -u <uid>) aborts at
    message-passing setup before reaching the shared-memory ACL check. A
    control run in which the excluded UID was explicitly added to
    allowedConsumer failed identically — confirming this is a generic QNX
    IPC-privilege limitation, not allowedConsumer enforcement. The denial
    therefore cannot be attributed to the ACL on QNX, so the test skips there;
    it runs on Linux, where an unprivileged UID can still bring up its endpoint
    and so reaches the ACL check the assertions rely on.

Verification

Run on both target configs:

  • QNX 8.0 under QEMU (--config=itf-qnx-x86_64): 8 passed, 3 skipped.
    test_mixed_criticality_acl_isolation skips here for the reason under
    Limitations; the other two skips are the vehicle-limitation cases above.
  • Linux under Docker (--config=linux-x86_64, which is what CI's "Linux —
    Build & Integration Test" job runs): 9 passed, 2 skipped.
    test_mixed_criticality_acl_isolation runs on this config and passes — the
    excluded UID reaches shared-memory open and is denied with an
    ACL/permission diagnostic, confirming the denial is attributable to
    allowedConsumer enforcement.
  • Requirement-traceability properties confirmed present in the generated
    JUnit XML (bazel-testlogs/.../itf/test.xml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant