goss
goss copied to clipboard
goss doesn't support semantic versioning for custom rpms
Hi, Its nice to use your tool. But there is an bug i have found it doesn't support custom versioing of rpms lets take an example Here is my goss.yaml {code} package: custom-service: installed: true versions: - "5.37.0-201709220549.68d18f9" service: custom-service: enabled: true running: true {code} when I try to validate it fails ...F
Failures/Skipped:
Package: custom-service: version:
Expected
<[]string | len:1, cap:1>: ["5.37.0"]
to contain element matching
Total Duration: 0.044s Count: 4, Failed: 1, Skipped: 0
need to add here in System->package_rpm.go p.loaded = true cmd := util.NewCommand("rpm", "-q", "--nosignature", "--nohdrchk", "--nodigest", "--qf", "%{VERSION}\n", p.name) if err := cmd.Run(); err != nil { return } p.installed = true p.versions = strings.Split(strings.TrimSpace(cmd.Stdout.String()), "\n")
Currently for RPM goss only checks the Version, not the Release.
$ rpm -q kernel-4.15.15-300.fc27.x86_64 --qf '%{Version}\n'
4.15.15
$ rpm -q kernel-4.15.15-300.fc27.x86_64 --qf '%{Release}\n'
300.fc27
Need to come up with a good syntax to support Release without breaking backwards compatibility, or rip the bandage off and make a breaking change to change rpm version to %{Version}-%{Release} and cut a major goss release.
Another approach would be to make the matcher special and make it work with both: 4.15.15 and 4.15.15-300.fc27
When i am cheking on puppet side. its looks its using different syntax which is matching for all type of rpm. /bin/rpm -q rpmname --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
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.
Epoch (optionally) and release will be in v0.4.0
This would be a breaking change, so waiting on v0.4.0