Skip to content

Add check config integration test#316

Open
RiSKeD wants to merge 3 commits into
mainfrom
test/check-config-integration-test
Open

Add check config integration test#316
RiSKeD wants to merge 3 commits into
mainfrom
test/check-config-integration-test

Conversation

@RiSKeD
Copy link
Copy Markdown
Contributor

@RiSKeD RiSKeD commented Apr 9, 2026

resolves #290

RiSKeD added 3 commits April 9, 2026 11:01
Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
The config validator now rejects main modules with args set, since main
modules receive their arguments from the client at runtime. The dummy
status command incorrectly had static args defined on the main module.

Remove the args; they can be passed on the command line when invoking
dutctl.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Build the dutagent binary in TestMain and run --check-config against
every module example config file, asserting exit 0 and the expected
"Configuration is valid" output.

Regression coverage for the GPIO --check-config panic and the
requirement that all shipped example configs are kept valid.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Copilot AI review requested due to automatic review settings April 9, 2026 09:05
@RiSKeD RiSKeD changed the title Test/check config integration test Check config integration test Apr 9, 2026
@RiSKeD RiSKeD changed the title Check config integration test Add check config integration test Apr 9, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an integration test to ensure dutagent --check-config successfully validates all shipped example module configs (regression coverage for the GPIO-related crash reported in #290), and updates example YAMLs to match current validation rules/module IDs.

Changes:

  • Add an integration test that builds dutagent and runs --check-config against every *-example-cfg.yml under pkg/module/*/.
  • Fix IPMI example config to reference the registered module ID (ipmi).
  • Remove invalid args usage from the dummy-status main module example.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/integration/dutagent/checkconfig_test.go Builds dutagent and validates all example configs via --check-config, asserting clean exit and expected output.
pkg/module/ipmi/ipmi-example-cfg.yml Updates example to use the correct module name (ipmi).
pkg/module/dummy/dummy-example-cfg.yml Removes invalid args from a main module example so config validation passes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration/dutagent/checkconfig_test.go
Comment thread test/integration/dutagent/checkconfig_test.go
Comment thread test/integration/dutagent/checkconfig_test.go
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.

dutagent config validation crash

2 participants