Open weakiwi opened 4 years ago
Adding plugin support would be really beneficial to goss. So when you say it's passed in through --plugin
would the goss test look as follows:
goss validate --plugin ./path/to/plugin
And the yaml (using your script for example):
plugin:
ethtool-plugin:
eth0:
is-virtual: true
is-bond: true
Yes. What you describe is better.
Ok, so here's some thoughts I have on this.
This doesn't match the pattern of the other tests and would need to change to be consistent (for merging and other reasons). From:
plugin:
ethtool-plugin:
eth0:
is-virtual: true
To:
plugin:
eth0:
plugin_type: ethtool-plugin
is-virtual: true
With those two features it will be possible to do the following:
command:
eth0:
# using echo as an example, this would need to be a script that dumps info in json format:
# ex: ./ethotool_plugin.sh json-dump eth0
exec: |
echo '{"is-bound": true, "is-virtual": false, "info": {"mac": "xxx"}}'
exit-status: 0
stdout:
and:
- jmespath: is-bound
matches: true
- jmespath: is-virtual
matches: true
- jmespath: info.mac
matches: xxx
timeout: 10000
I would love to get the community feedback on 1 and 2.. Some high level differences I can think of: Pros/cons of 1: Pros:
Cons:
Pros/cons of 2: Pros:
Cons:
Would love your thoughts on this. Same with @pedroMMM, @donmstewart and anyone else interested in plugin support
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
gjson
matcher, this will allow option 2 above, is this sufficient?
Describe the feature:
Sometimes, we want to use some 3rd tools (like ethotool and demicode) to do some test. On current stage we can use Command to test. But I think it's better to implement plugins so that user can define their own test method.
Describe the solution you'd like
./plugin name
will output plugin's name./plugin options
will output a list with plugin's options for goss to call. Like a ethtool plugin should outputspeed, is-bond, is-virtual
etc./plugin test-method test-target
will output the test result. E.g: ethtool plugin,./ethotool_plugin.sh is-virtual etho0
will output true./plugin name
and./plugin options
output.Describe alternatives you've considered
For the implement of plugins, I have an idea. I use python to explain the code logic. We can talk about the implement and then I can create a new PR for this.