Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Release v1.3.0 ACPI Driver #12

Merged
merged 6 commits into from
Jul 31, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: fixes issues in fuzzing (#24)
- moves cores to shared pool in fuzz test to prevent error
- adds cstate operation to test
  • Loading branch information
adorney99 authored and KingKoopasGoomba committed Jul 26, 2023
commit 6fb9dfd5d7b115d8410655c8e9de00c12e070457
18 changes: 16 additions & 2 deletions pkg/power/power_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func Fuzz_library(f *testing.F) {
"min": "100",
"epp": "some",
"driver": "intel_pstate",
"available_governors": "conservative ondemand userspace powersave",
"package": "0",
"die": "0",
}
Expand All @@ -168,7 +169,7 @@ func Fuzz_library(f *testing.F) {
defer teardownUncore()
governorList := []string{"powersave", "performance"}
eppList := []string{"power", "performance", "balance-power", "balance-performance"}
//f.Add("node1","performance",uint(250000),uint(120000),uint(5),uint(10))
f.Add("node1","performance",uint(250000),uint(120000),uint(5),uint(10))
fuzzTarget := func(t *testing.T, nodeName string, poolName string, value1 uint, value2 uint, governorSeed uint, eppSeed uint) {
basePath = "testing/cpus"
getNumberOfCpus = func() uint { return 8 }
Expand Down Expand Up @@ -201,6 +202,15 @@ func Fuzz_library(f *testing.F) {
if err != nil {
return
}
err = pool.SetCStates(CStates{"C0": true, "C1": false})
if err != nil {
t.Error("could not set ctates", err)
}
states := pool.getCStates()
err = node.ValidateCStates(*states)
if err != nil {
t.Error("invalid cstates detected", err)
}
switch profile.(type) {
default:
t.Error("profile is null")
Expand All @@ -210,7 +220,10 @@ func Fuzz_library(f *testing.F) {
if epp == "power" {
return
}

err = node.GetSharedPool().MoveCpuIDs([]uint{1, 3, 5})
if err != nil {
t.Error("could not move cores to shared pool", err)
}
err = node.GetExclusivePool(poolName).MoveCpuIDs([]uint{1, 3, 5})
if err != nil {
t.Error("could not move cores to exclusive pool", err)
Expand All @@ -236,6 +249,7 @@ func Fuzz_library(f *testing.F) {
if err != nil {
t.Error("could not set die uncore", err)
}

}
f.Fuzz(fuzzTarget)

Expand Down