-
Notifications
You must be signed in to change notification settings - Fork 471
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
'ports check' supports for multiply IPs #27
Comments
At the momment results are not stable due to goss error. The issue reported to upsteam: goss-org/goss#27 > Failures: > Port: tcp:1443: ip: doesn't match, expect: [10.15.20.169] found: [127.0.0.1] > Port: tcp:443: ip: doesn't match, expect: [10.15.20.169] found: [127.0.0.1] > > Total Duration: 0.436s > Count: 259, Failed: 2 It should be re-enabled as soon as goss is fixed. Change-Id: Iae2db3a29dd77b99733a92ec017ad00012ab0a87
At the momment results are not stable due to goss error. The issue reported to upsteam: goss-org/goss#27 > Failures: > Port: tcp:1443: ip: doesn't match, expect: [10.15.20.169] found: [127.0.0.1] > Port: tcp:443: ip: doesn't match, expect: [10.15.20.169] found: [127.0.0.1] > > Total Duration: 0.436s > Count: 259, Failed: 2 It should be re-enabled as soon as goss is fixed. Change-Id: Iae2db3a29dd77b99733a92ec017ad00012ab0a87 (cherry picked from commit f72490b)
I've attached a compiled copy from that pull request. I don't have a machine with multiple IPs configured and haven't had the time to create a test for this in docker. Let me know if the attached version works properly for you and I'll cut a release with this feature. This new version is not backwards compatible with old goss.json files, run the following on your existing files to migrate them:
|
Tested, briefly looks OK. The initial problem 'ip: doesn't match' has gone. In same same time the new functionality "ip": [ "1.1.1.1" , "1.1.1.2" ] doesn't really work well. Maybe we need to have ability to specify match criteria ALL or ANY:
In the same time it is a way for complication the logic, so maybe you just have to dismiss that new feature request. K.I.S.S. |
I've broken my post down into two sections, please let me know if I'm understanding you correctly for both parts. My understanding of the IP issue Here's the behavior I'm getting in my contrived test: {
"port": {
"tcp:22": {
"listening": true,
"ip": [
"0.0.0.0",
"0.0.0.0"
]
}
}
} That gives me Changing one of the That said, if there were 10 IP's listening on that port, and I only list 2 in my goss.json, only those 2 would be tested and I would get success. This is the way all the other goss tests work, user resource defining groups is "user is a member of X, Y groups" will succeed even if the user is in X, Y AND Z groups. I'll cut a release later tonight, thank you for your feedback and testing. My understanding of new feature The criteria feature is something that I want to implement at some point, but it would have to affect all resources/attributes. The hard part for me is figuring out a good syntax that's easy to read but allows for the flexibility. Also deciding what to support. Features, that might be useful:
I'm guessing ALL/ANY is the most important one for now. I'll create a ticket to brainstorm this further if this is what you meant. |
This is fixed in v0.0.17 |
See #31 for enhanced matcher logic. |
The ip field format has been changed in 0.0.17: > goss-org/goss#27 (comment) Change-Id: I433712401f330f604ceebe76deb9774409aeeca8
As of v0.1.0 you can now do:
|
Nice tnx! I will try it. Is there any place for goss release-notes/changelog I can read? UPDATE: Ah I missed it https://github.com/aelsabbahy/goss/releases tnx! |
Hi,
First of all thank you for the nice and really fast tool!
I am trying to check ports using goss v0.0.16 and have a problems with multiply IPs identification:
In the same time the following config works well:
I believe goss should check all available IPs and doesn't fail on the first failed match. Isn't it?
BTW, it would be nice to define multiply IPs like:
Thank you!
The text was updated successfully, but these errors were encountered: