Conditionally skip test based on osbuild-compose.rpm version from distro
This commit is contained in:
parent
81c1262969
commit
eb5dd8ae1b
1 changed files with 19 additions and 0 deletions
|
|
@ -12,7 +12,10 @@ package client
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
|
@ -1107,6 +1110,22 @@ func TestBlueprintFreezeGlobsV0(t *testing.T) {
|
|||
t.Skip()
|
||||
}
|
||||
|
||||
// works with osbuild-composer v83 and later
|
||||
rpm_q := exec.Command("rpm", "-q", "--qf", "%{version}", "osbuild-composer")
|
||||
out, err := rpm_q.CombinedOutput()
|
||||
if err != nil {
|
||||
assert.Fail(t, fmt.Sprintf("Error during rpm -q: %s", err))
|
||||
}
|
||||
|
||||
rpm_version, err := strconv.Atoi(string(out))
|
||||
if err != nil {
|
||||
assert.Fail(t, "Error during str-int conversion", err)
|
||||
}
|
||||
|
||||
if rpm_version < 83 {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
bp := `{
|
||||
"name": "test-freeze-blueprint-glob-v0",
|
||||
"description": "TestBlueprintFreezeGlobsV0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue