Skip to content

Commit

Permalink
Merge pull request #28261 from jeff-roche/rteval
Browse files Browse the repository at this point in the history
OCPVE-295: rteval
  • Loading branch information
openshift-merge-robot authored Sep 23, 2023
2 parents 086eac3 + 78fe016 commit 9732ab3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
5 changes: 5 additions & 0 deletions test/extended/kernel/kernel_rt_latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ var _ = g.Describe("[sig-node][Suite:openshift/nodes/realtime/latency][Disruptiv
o.Expect(err).NotTo(o.HaveOccurred(), "error occured running cyclictest")
})

g.It("rteval", func() {
err := runRteval(oc)
o.Expect(err).NotTo(o.HaveOccurred(), "error occured running rteval")
})

g.AfterEach(func() {
cleanupRtTestPod(oc)
})
Expand Down
61 changes: 58 additions & 3 deletions test/extended/kernel/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ package kernel

import (
"encoding/json"
"encoding/xml"
"fmt"
"strconv"
"time"

exutil "github.com/openshift/origin/test/extended/util"
"github.com/pkg/errors"
)

const (
hwlatdetectThresholdusec = 5000
oslatThresholdusec = 5000
cyclictestThresholdusec = 5000
hwlatdetectThresholdusec = 7500
oslatThresholdusec = 7500
cyclictestThresholdusec = 7500
rtevalThresholdusec = 7500
)

func runPiStressFifo(oc *exutil.CLI) error {
Expand Down Expand Up @@ -185,3 +188,55 @@ func getProcessorCount(oc *exutil.CLI) (int, error) {

return count, nil
}

type rtevalOutput struct {
XMLName xml.Name `xml:"rteval"`
Statistics struct {
XMLName xml.Name `xml:"statistics"`
Samples int `xml:"samples"`
Minimum int `xml:"minimum"`
Maximum int `xml:"maximum"`
Median float32 `xml:"median"`
Mode int `xml:"mode"`
Range int `xml:"range"`
Mean float32 `xml:"mean"`
MeanAbsoluteDeviation float32 `xml:"mean_absolute_deviation"`
StandardDeviation float32 `xml:"standard_deviation"`
} `xml:"Measurements>Profile>cyclictest>system>statistics"`
}

func runRteval(oc *exutil.CLI) error {
// The working directory for the pod under test
// This is where rteval will create a directory and write results
rtevalWorkDir := "/tmp"

// Run the test
args := []string{rtPodName, "--", "rteval", "--duration=10m", fmt.Sprintf("--workdir=%s", rtevalWorkDir)}
_, err := oc.SetNamespace(rtNamespace).Run("exec").Args(args...).Output()
if err != nil {
return errors.Wrap(err, "error running rteval")
}

// rteval-YYYYMMDD-S This is a directory created by rteval to hold the summary.xml file where S is the Sequence this has been run (should be 1 for this test)
today := time.Now().Format("20060102") // YYYYMMDD
summaryFile := fmt.Sprintf("%s/rteval-%s-%d/summary.xml", rtevalWorkDir, today, 1)

// Gather the results
args = []string{rtPodName, "--", "cat", summaryFile}
report, err := oc.SetNamespace(rtNamespace).Run("exec").Args(args...).Output()
if err != nil {
return errors.Wrap(err, "error retrieving rteval results")
}

var res rtevalOutput
if err := xml.Unmarshal([]byte(report), &res); err != nil {
return errors.Wrap(err, "Unable to parse rteval xml report")
}

// Verify we meet the threshold value
if res.Statistics.Maximum > rtevalThresholdusec {
return fmt.Errorf("maximum rteval latency of %d usec exceeded maximum allowed of %d usec", res.Statistics.Maximum, rtevalThresholdusec)
}

return nil
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9732ab3

Please sign in to comment.