Skip to content
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

Add Version Check to Reserved Core Freqency Tuning Test. Fix and move CompareOCPVersionWithCurrent() #51

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/cnf/ran/powermanagement/internal/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func SetCPUFreq(
desiredReservedCoreFreq *performancev2.CPUfrequency) error {
glog.V(tsparams.LogLevel).Infof("Set Reserved and Isolated CPU Frequency on performance profile")

if perfProfile.Definition.Spec.HardwareTuning == nil {
perfProfile.Definition.Spec.HardwareTuning = &performancev2.HardwareTuning{}
}

// Update PerfProfile with new CPU Frequencies
perfProfile.Definition.Spec.HardwareTuning.IsolatedCpuFreq = desiredIsolatedCoreFreq
perfProfile.Definition.Spec.HardwareTuning.ReservedCpuFreq = desiredReservedCoreFreq
Expand Down
11 changes: 10 additions & 1 deletion tests/cnf/ran/powermanagement/tests/cpufreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/cluster"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/ranhelper"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/powermanagement/internal/helper"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/powermanagement/internal/tsparams"
Expand Down Expand Up @@ -63,7 +64,15 @@ var _ = Describe("CPU frequency tuning tests change the core frequencies of isol
When("reserved and isolated core frequency is configured via PerformanceProfile", func() {

It("sets the reserved and isolated core frequency correctly on the DUT", func() {
err := helper.SetCPUFreq(perfProfile, &desiredIsolatedCoreFreq, &desiredReservedCoreFreq)

versionInRange, err := ranhelper.IsVersionStringInRange(RANConfig.Spoke1OCPVersion, "4.16", "")
Expect(err).ToNot(HaveOccurred(), "Failed to compare OCP version string")

if !versionInRange {
Skip("OCP 4.16 or higher required for this test")
}

err = helper.SetCPUFreq(perfProfile, &desiredIsolatedCoreFreq, &desiredReservedCoreFreq)
Expect(err).ToNot(HaveOccurred(), "Failed to set CPU Freq")

})
Expand Down
Loading