kola/tests/rpmostree: improve regex for version checking
The version string for RHCOS has changed since the original version of
this code, so relax the regex for determining the version string.
@@ -36,7 +36,7 @@ func init() {
var (
// Regex to extract version number from "rpm-ostree status"
- rpmOstreeVersionRegex string = `^Version: ([\d.]+).*`
+ rpmOstreeVersionRegex string = `^Version: ([0-9a-zA-Z.]+).*`
)
// rpmOstreeCleanup calls 'rpm-ostree cleanup -rpmb' on a host and verifies
@@ -95,7 +95,7 @@ func rpmOstreeStatus(c cluster.TestCluster) {
for _, line := range statusArray {
versionMatch := reVersion.FindStringSubmatch(strings.Trim(line, " "))
if versionMatch != nil {
- // versionMatch should be like `[Version: 4.0.5516 (2018-09-12 17:22:06) 4.0.5516]`
+ // versionMatch should be like `[Version: 420.8.20190711.0 (2019-07-11T09:00:04Z) 420.8.20190711.0]`
// i.e. the full match and the group we want
// `versionMatch[len(versionMatch)-1]` gets the last element in the array
rpmOstreeVersion = versionMatch[len(versionMatch)-1]
