-
Notifications
You must be signed in to change notification settings - Fork 473
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
package version checks should allow ranges (Feature request) #435
Comments
It's somewhat related to #355, semver is a check I would like to add as an advanced macher However, each package manager uses its own way to compare versions, so that may or may not be helpful depending on the package manager and it's comparison rules. For example RPM uses the following logic to compare versions: |
for Rpm based:- |
@aelsabbahy #508 should take care of this. Simple check package:
kernel:
installed: true
versions:
version-gt: "4.0.0" Range check package:
kernel:
installed: true
versions:
and:
- version-gt: 4.0.0
- version-lt: 5.0.0 |
Just to clarify, @pedroMMM PR is a great addition for a semver matcher. I'm looking forward to that PR as it will allow goss with minor changes to support semver matching for command/http/file resources. However, this does not solve package versioning/ranges, a quick test on the debian test image fails to parse for ~7-8% of the installed packages. Also, rpm does not adhere to semantic versioning, for example.. but goss currently only checks '%{Version}' and not release, so may be a moot point for now.. Although, they may have to be added back in to do proper version comparisons in the future. Here's an example where semver and rpm do different things:
I haven't done a deep enough dive with debian (beyond parsing errors) to see how deb package versions differ from semver. |
@sshipway yesterdays release contains a semver Matcher. Which package type where you testing with? |
We have Centos/Redhat systems, so RPMs, though I tend to develop on an ubuntu system. |
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. |
Tracked in one ticket: #334 |
I was mistaken, this is different from #334 |
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. |
When specifying a required package version, it should be possible to use ranges (> or < ). This would allow a test for 'at least this version' (to avoid a known bug) or 'no later than this version' (to avoid incompatibilities). Ideally, the syntax could also allow 'or not installed' as an extension to this.
May be related to #355
The text was updated successfully, but these errors were encountered: