Skip to content

test: capture DUT syslog per test - #1683

Draft
saba8814 wants to merge 5 commits into
mainfrom
test-syslog-capture
Draft

saba8814 wants to merge 5 commits into
mainfrom
test-syslog-capture

Conversation

@saba8814

@saba8814 saba8814 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces a way for Infamy to log a marker on each DUT when a test attaches, and another when the test exits. The syslog lines between the two are fetched
over SSH and saved next to the test output:

test/.log/<run>/output/0006-set-hostname.log
test/.log/<run>/syslog/0006-set-hostname-{target}.log

Each marker also carries the host's time, so DUT lines can be lined up with the
test output. Markers are only logged at test start and end to keep overhead down.
Capture is best-effort: if a DUT has rebooted or can't be reached, the
test gets a diagnostic comment and no syslog file. The test result is
never affected.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@saba8814
saba8814 marked this pull request as draft October 3, 2026 17:55
@saba8814
saba8814 force-pushed the test-syslog-capture branch from f8d1146 to d02b9db Compare October 3, 2026 17:57
This commit introduces a way for Infamy to log a marker on each DUT when a test attaches, and another
when the test exits.  The syslog lines between the two are fetched
over SSH and saved next to the test output:

    test/.log/<run>/output/0006-set-hostname.log
    test/.log/<run>/syslog/0006-set-hostname-{target}.log

Each marker also carries
the host's wall-clock time, so DUT lines can be lined up with the
test output. Markers are only logged at test start and end to keep overhead down.
Capture is best-effort: if a DUT has rebooted or can't be reached, the
test gets a diagnostic comment and no syslog file.  The test result is
never affected.

Resolves: #1608

Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
Capturing syslog adds an SSH call per DUT when each test exits, and
most runs don't need the logs.  Capture is now off unless enabled
with the new --capture-syslog Infamy argument, or with:

    make TEST_SYSLOG_CAPTURE=y test

Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
Explain what is saved, where the files end up, and how to enable it
for make test and for interactive 9pm runs.

Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
@saba8814
saba8814 force-pushed the test-syslog-capture branch from d02b9db to fafe7e4 Compare October 3, 2026 18:04
@saba8814 saba8814 changed the title test: capture DUT syslog per test (opt-in) test: capture DUT syslog per test Oct 3, 2026
As discussed in #1608, DUTs now send their syslog to the test
container instead of Infamy fetching it over SSH.  Logs up to a crash
or reboot are kept, and each test and DUT gets its own directory:

    test/.log/<run>/syslog/<test>/<dut>/syslog

Test start and stop are marked with the log RPC, msgid test-start and
test-stop.  The container image gets sysklogd and is bumped to 2.15.
Capture is still off by default.

Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
@saba8814 saba8814 added the ci:skip Skip CI for this PR, started jobs are stopped. label Oct 3, 2026

This branch has not been deployed

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

Labels

ci:skip Skip CI for this PR, started jobs are stopped.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant