Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and load test-config when in test-mode #569

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

axkar
Copy link
Collaborator

@axkar axkar commented Aug 20, 2024

Currently, it's not possible to run infix tests from an external project (based on infix) due to an incompatibility between the
configuration used in the tests (the default configuration within the image generated by the external project) and the infix
base configuration expected by the test cases.
Therefore, a simple configuration specifically for testing purposes needs to be generated within an image.
This test-config should only be generated and loaded when the device is in test mode.

src/confd/bin/bootstrap Outdated Show resolved Hide resolved
src/confd/bin/bootstrap Outdated Show resolved Hide resolved
doc/introduction.md Outdated Show resolved Hide resolved
doc/introduction.md Outdated Show resolved Hide resolved
src/confd/share/test.d/10-netconf-server.json Outdated Show resolved Hide resolved
src/confd/share/test.d/10-nacm.json Outdated Show resolved Hide resolved
src/confd/share/test.d/10-infix-services.json Outdated Show resolved Hide resolved
src/confd/share/test.d/10-infix-services.json Outdated Show resolved Hide resolved
src/confd/share/test.d/10-system.json Show resolved Hide resolved
Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

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

I second Mattias' comments and I'd also like to understand why the config is named test-config rather than safe-config, as described in #561. Please add motivation for this discrepancy.

@mattiaswal
Copy link
Contributor

mattiaswal commented Aug 22, 2024

I second Mattias' comments and I'd also like to understand why the config is named test-config rather than safe-config, as described in #561. Please add motivation for this discrepancy.

Since we above (#569 (comment)) decided that it should only be generated if test-mode, i think test-config.cfg is better. Tell what it is, why it is there etc. But there may also be other uses, in that case we can rename it then. Since it is only used in test-mode today.

Didn't we use this for provision of config in our previous life @troglobit ?

@mattiaswal
Copy link
Contributor

Also:
#571 (comment)
is also valid here.

@axkar
Copy link
Collaborator Author

axkar commented Aug 22, 2024

Also: #571 (comment) is also valid here.

Added reference :)

Copy link
Contributor

@mattiaswal mattiaswal left a comment

Choose a reason for hiding this comment

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

Only minor cosmetic stuff, the name issue is still there @troglobit should it be safe-config?

package/confd/tmpfiles.conf Outdated Show resolved Hide resolved
src/confd/share/test.d/Makefile.am Outdated Show resolved Hide resolved
@troglobit
Copy link
Contributor

I second Mattias' comments and I'd also like to understand why the config is named test-config rather than safe-config, as described in #561. Please add motivation for this discrepancy.

Since we above (#569 (comment)) decided that it should only be generated if test-mode, i think test-config.cfg is better. Tell what it is, why it is there etc. But there may also be other uses, in that case we can rename it then. Since it is only used in test-mode today.

Didn't we use this for provision of config in our previous life @troglobit ?

OK, fair point. We can add a safe-config later when we have an actual use-case for it.

Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

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

I'm fine with this as long as Mattias' last comments are addressed.

Currently, it's not possible to run infix tests from an external
project (based on infix) due to an incompatibility between the
configuration used in the tests (the default configuration
within the image generated by the external project) and the infix
base configuration expected by the test cases. Therefore, a simple
configuration specifically for testing purposes needs to be generated
within an image. This test-config should always be generated
but only loaded when the device is in test mode.

Part of issue kernelkit#568
- removed unused parameters in functions factory() and failure()
- renamed the functions
@mattiaswal mattiaswal merged commit 21274aa into kernelkit:main Aug 23, 2024
2 checks passed
@axkar axkar deleted the generate-test-cfg branch August 23, 2024 09: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