Skip to content

Conversation

dougsland
Copy link
Member

@dougsland dougsland commented Jul 29, 2025

  • qm-to-qm
  • asil-to-qm

Summary by Sourcery

Introduce tests for IPC by adding a Unix domain socket server, client, container definitions, FMF metadata, and shell scripts to automate QM-to-QM and ASIL-to-QM IPC test workflows.

New Features:

  • Add a threaded Unix domain socket server with optional systemd socket activation that logs client timestamps
  • Add a client script that continuously sends timestamp messages to the IPC server with automatic reconnection on failure

Build:

  • Add Containerfiles for building and packaging the IPC client and server into Fedora-based images

Documentation:

  • Add README files with instructions to build and push the IPC client and server container images

Tests:

  • Add end-to-end shell test scripts for QM-to-QM and ASIL-to-QM IPC workflows

Chores:

  • Add FMF metadata files for QM-to-QM and ASIL-to-QM IPC tests

Copy link
Contributor

sourcery-ai bot commented Jul 29, 2025

Reviewer's Guide

This PR adds a complete IPC-based testing framework for QM components using Unix domain sockets, implemented through new Python server and client scripts with systemd activation support, containerization via Containerfiles, shell-based orchestration of IPC scenarios, and accompanying documentation and FMF metadata.

File-Level Changes

Change Details Files
Implemented threaded Unix domain socket server with systemd activation fallback
  • Added Handler class to read and log client messages
  • Created ThreadedUnixStreamServer supporting systemd FD activation
  • Provided direct socket creation and stale-socket cleanup logic
tests/qm-ipc/server/server.py
Created Unix socket client to send timestamp messages with retry logic
  • Defined SimpleMessage for timestamp formatting
  • Implemented send_loop with reconnection on failure
  • Integrated systemd-style logging
tests/qm-ipc/client/client.py
Added shell test runners for QM IPC scenarios
  • Wrote test_asiltoqm.sh invoking 'asil-to-qm' script
  • Wrote test_qmtoqm.sh invoking 'qm-to-qm' script
  • Used common utils for logging and exit handling
tests/qm-ipc/test_asiltoqm.sh
tests/qm-ipc/test_qmtoqm.sh
Packaged IPC server and client as container images
  • Created Containerfile for ipc-client image
  • Created Containerfile for ipc-server image
tests/qm-ipc/client/Containerfile
tests/qm-ipc/server/Containerfile
Added documentation for building and publishing IPC containers
  • Authored README for client image build/push instructions
  • Authored README for server image build/push instructions
tests/qm-ipc/client/README.md
tests/qm-ipc/server/README.md
Included FMF metadata and helper scripts for test orchestration
  • Added FMF test definitions (asimtoqm.fmf, qmtoqm.fmf)
  • Created scripts directory with common and scenario scripts
tests/qm-ipc/asiltoqm.fmf
tests/qm-ipc/qmtoqm.fmf
tests/qm-ipc/scripts/asil-to-qm
tests/qm-ipc/scripts/common
tests/qm-ipc/scripts/qm-to-qm

Possibly linked issues

  • #0: The PR adds a complete IPC testing framework with Unix sockets, containerized apps, and ASIL-QM tests, directly fulfilling the issue's requirements.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dougsland dougsland marked this pull request as draft July 29, 2025 20:30
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dougsland - I've reviewed your changes - here's some feedback:

  • scripts/asil-to-qm and scripts/qm-to-qm are empty – please implement these test scripts so test_ipc.sh can actually exercise your IPC client/server.
  • main.fmf is currently empty – add FMF metadata to define your IPC tests and configure the test harness to discover and run them.
  • Consider ensuring proper startup and teardown of the IPC server (e.g. cleaning up stale socket files or adding a timeout/shutdown mechanism) to avoid flakiness between test runs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- scripts/asil-to-qm and scripts/qm-to-qm are empty – please implement these test scripts so test_ipc.sh can actually exercise your IPC client/server.
- main.fmf is currently empty – add FMF metadata to define your IPC tests and configure the test harness to discover and run them.
- Consider ensuring proper startup and teardown of the IPC server (e.g. cleaning up stale socket files or adding a timeout/shutdown mechanism) to avoid flakiness between test runs.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dougsland dougsland force-pushed the ipc-testing-qm-images branch 6 times, most recently from 1933f04 to f13109b Compare July 29, 2025 21:08
@aesteve-rh
Copy link
Collaborator

FYI, there is an effort to move these script from python to c: https://gitlab.com/CentOS/automotive/sig-docs/-/merge_requests/362

Also, afaik there is an effort in place to run sig-docs setups in qm, which would make this PR partially redundant (cc @pbrilla-rh )

Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see QM -> QM logs running at all
And i do not know why /var partition check is failing
In other MR s it is passing

@dougsland
Copy link
Member Author

dougsland commented Aug 4, 2025

FYI, there is an effort to move these script from python to c: https://gitlab.com/CentOS/automotive/sig-docs/-/merge_requests/362

Also, afaik there is an effort in place to run sig-docs setups in qm, which would make this > PR partially redundant (cc @pbrilla-rh )
FYI, there is an effort to move these script from python to c:
https://gitlab.com/CentOS/automotive/sig-docs/-/merge_requests/362

Also, afaik there is an effort in place to run sig-docs setups in qm, which would make this
PR partially redundant (cc @pbrilla-rh )

Thanks, @aesteve-rh. It's okay to close this one, but I'm wondering why such tests aren't run in the QM git tree before merging any patches. Also, we still need QM-to-QM as well.
@Yarboa @engelmi

@dougsland
Copy link
Member Author

FYI, there is an effort to move these script from python to c: https://gitlab.com/CentOS/automotive/sig-docs/-/merge_requests/362
Also, afaik there is an effort in place to run sig-docs setups in qm, which would make this > PR partially redundant (cc @pbrilla-rh )
FYI, there is an effort to move these script from python to c:
https://gitlab.com/CentOS/automotive/sig-docs/-/merge_requests/362
Also, afaik there is an effort in place to run sig-docs setups in qm, which would make this
PR partially redundant (cc @pbrilla-rh )

Thanks, @aesteve-rh. It's okay to close this one, but I'm wondering why such tests aren't run in the QM git tree before
merging any patches. Also, we still need QM-to-QM as well. @Yarboa @engelmi

spoke with @engelmi and we agreed that might be a conflict but as we need this in qm upstream it's okay to have both.

@dougsland dougsland force-pushed the ipc-testing-qm-images branch 10 times, most recently from e52423d to 5f8bece Compare August 11, 2025 13:37
@dougsland dougsland force-pushed the ipc-testing-qm-images branch 5 times, most recently from 800c754 to be7583a Compare August 11, 2025 20:54
- qm-to-qm
- asil-to-qm

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Signed-off-by: Roberto Majadas <rmajadas@redhat.com>
@dougsland dougsland force-pushed the ipc-testing-qm-images branch 2 times, most recently from ecf5a77 to a313785 Compare August 12, 2025 01:02
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
@dougsland dougsland force-pushed the ipc-testing-qm-images branch from a313785 to a2e6576 Compare August 12, 2025 14:27
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
@dougsland dougsland force-pushed the ipc-testing-qm-images branch from 05d644b to fcf6ba1 Compare August 12, 2025 15:06
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
@Yarboa Yarboa marked this pull request as ready for review August 14, 2025 06:54
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dougsland dougsland merged commit b572594 into main Aug 14, 2025
19 checks passed
@dougsland dougsland deleted the ipc-testing-qm-images branch August 14, 2025 18:15
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.

3 participants