@@ -32,6 +32,8 @@ import (
32
32
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/cgroup"
33
33
testclient "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/client"
34
34
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/discovery"
35
+ "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/infrastructure"
36
+ "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/label"
35
37
testlog "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/log"
36
38
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/mcps"
37
39
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/nodes"
@@ -45,14 +47,16 @@ const (
45
47
cgroupRoot = "/rootfs/sys/fs/cgroup"
46
48
)
47
49
48
- var _ = Describe ("[rfe_id:49062][workloadHints] Telco friendly workload specific PerformanceProfile API" , func () {
49
- var workerRTNodes []corev1.Node
50
- var profile , initialProfile * performancev2.PerformanceProfile
51
- var performanceMCP string
52
- var err error
53
-
50
+ var _ = Describe ("[rfe_id:49062][workloadHints] Telco friendly workload specific PerformanceProfile API" , Label (string (label .WorkloadHints )), func () {
51
+ var (
52
+ workerRTNodes []corev1.Node
53
+ profile , initialProfile * performancev2.PerformanceProfile
54
+ performanceMCP string
55
+ err error
56
+ ctx context.Context = context .Background ()
57
+ isIntel , isAMD bool
58
+ )
54
59
nodeLabel := testutils .NodeSelectorLabels
55
-
56
60
BeforeEach (func () {
57
61
if discovery .Enabled () && testutils .ProfileNotFound {
58
62
Skip ("Discovery mode enabled, performance profile not found" )
@@ -65,6 +69,11 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
65
69
performanceMCP , err = mcps .GetByProfile (profile )
66
70
Expect (err ).ToNot (HaveOccurred ())
67
71
klog .Infof ("using performanceMCP: %q" , performanceMCP )
72
+ // Check if one of the nodes is intel or AMD using Vendor ID
73
+ isIntel , err = infrastructure .IsIntel (ctx , & workerRTNodes [0 ])
74
+ Expect (err ).ToNot (HaveOccurred (), "Unable to fetch Vendor ID" )
75
+ isAMD , err = infrastructure .IsAMD (ctx , & workerRTNodes [0 ])
76
+ Expect (err ).ToNot (HaveOccurred (), "Unable to fetch Vendor ID" )
68
77
69
78
// Verify that worker and performance MCP have updated state equals to true
70
79
for _ , mcpName := range []string {testutils .RoleWorker , performanceMCP } {
@@ -218,8 +227,10 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
218
227
"kernel.sched_rt_runtime_us" : "950000" ,
219
228
"vm.stat_interval" : "10" ,
220
229
}
221
- kernelParameters := []string {"processor.max_cstate=1" , "intel_idle.max_cstate=0" }
222
-
230
+ kernelParameters := []string {"processor.max_cstate=1" }
231
+ if isIntel {
232
+ kernelParameters = append (kernelParameters , "intel_idle.max_cstate=0" )
233
+ }
223
234
wg := sync.WaitGroup {}
224
235
By ("Waiting for TuneD to start on nodes" )
225
236
for i := 0 ; i < len (workerRTNodes ); i ++ {
@@ -284,8 +295,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
284
295
"vm.stat_interval" : "10" ,
285
296
}
286
297
kernelParameters := []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" ,
287
- "processor.max_cstate=1" , "intel_idle.max_cstate=0" , "idle=poll" }
288
-
298
+ "processor.max_cstate=1" , "idle=poll" }
289
299
wg := sync.WaitGroup {}
290
300
By ("Waiting for TuneD to start on nodes" )
291
301
for i := 0 ; i < len (workerRTNodes ); i ++ {
@@ -306,7 +316,9 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
306
316
fmt .Sprintf ("stalld is not running on %q when it should" , node .Name ))
307
317
308
318
By (fmt .Sprintf ("Checking TuneD parameters on %q" , node .Name ))
309
- kernelParameters = append (kernelParameters , utilstuned .AddPstateParameter (context .TODO (), node ))
319
+ if isIntel {
320
+ kernelParameters = append (kernelParameters , "intel_idle.max_cstate=0" , utilstuned .AddPstateParameter (context .TODO (), node ))
321
+ }
310
322
utilstuned .CheckParameters (context .TODO (), node , sysctlMap , kernelParameters , stalldEnabled , rtKernel )
311
323
}()
312
324
}
@@ -343,9 +355,15 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
343
355
By ("Verifying node kernel arguments" )
344
356
cmdline , err := nodes .ExecCommandOnMachineConfigDaemon (context .TODO (), & workerRTNodes [0 ], []string {"cat" , "/proc/cmdline" })
345
357
Expect (err ).ToNot (HaveOccurred ())
346
- Expect (cmdline ).To (ContainSubstring ("intel_pstate=passive" ))
347
- Expect (cmdline ).ToNot (ContainSubstring ("intel_pstate=active" ))
358
+ if isIntel {
359
+ Expect (cmdline ).To (ContainSubstring ("intel_pstate=passive" ))
360
+ Expect (cmdline ).ToNot (ContainSubstring ("intel_pstate=active" ))
361
+ }
348
362
363
+ if isAMD {
364
+ Expect (cmdline ).To (ContainSubstring ("amd_pstate=passive" ))
365
+ Expect (cmdline ).ToNot (ContainSubstring ("amd_pstate=active" ))
366
+ }
349
367
By ("Verifying tuned profile" )
350
368
key := types.NamespacedName {
351
369
Name : components .GetComponentName (profile .Name , components .ProfileNamePerformance ),
@@ -405,7 +423,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
405
423
"vm.stat_interval" : "10" ,
406
424
}
407
425
kernelParameters := []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" ,
408
- "processor.max_cstate=1" , "intel_idle.max_cstate=0" , " idle=poll" }
426
+ "processor.max_cstate=1" , "idle=poll" }
409
427
410
428
wg := sync.WaitGroup {}
411
429
By ("Waiting for TuneD to start on nodes" )
@@ -427,7 +445,9 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
427
445
fmt .Sprintf ("stalld is not running on %q when it should" , node .Name ))
428
446
429
447
By (fmt .Sprintf ("Checking TuneD parameters on %q" , node .Name ))
430
- kernelParameters = append (kernelParameters , utilstuned .AddPstateParameter (context .TODO (), node ))
448
+ if isIntel {
449
+ kernelParameters = append (kernelParameters , "intel_idle.max_cstate=0" , utilstuned .AddPstateParameter (context .TODO (), node ))
450
+ }
431
451
utilstuned .CheckParameters (context .TODO (), node , sysctlMap , kernelParameters , stalldEnabled , rtKernel )
432
452
}()
433
453
}
@@ -470,8 +490,14 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
470
490
"kernel.sched_rt_runtime_us" : "-1" ,
471
491
"vm.stat_interval" : "10" ,
472
492
}
473
- kernelParameters = []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" , "intel_pstate=passive" }
493
+ kernelParameters = []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" }
494
+ if isIntel {
495
+ kernelParameters = append (kernelParameters , "intel_pstate=passive" )
496
+ }
474
497
498
+ if isAMD {
499
+ kernelParameters = append (kernelParameters , "amd_pstate=passive" )
500
+ }
475
501
wg = sync.WaitGroup {}
476
502
By ("Waiting for TuneD to start on nodes" )
477
503
for i := 0 ; i < len (workerRTNodes ); i ++ {
@@ -542,7 +568,13 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
542
568
"kernel.sched_rt_runtime_us" : "-1" ,
543
569
"vm.stat_interval" : "10" ,
544
570
}
545
- kernelParameters := []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" , "intel_pstate=passive" }
571
+ kernelParameters := []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" }
572
+ if isIntel {
573
+ kernelParameters = append (kernelParameters , "intel_pstate=passive" )
574
+ }
575
+ if isAMD {
576
+ kernelParameters = append (kernelParameters , "amd_pstate=passive" )
577
+ }
546
578
547
579
wg := sync.WaitGroup {}
548
580
By ("Waiting for TuneD to start on nodes" )
@@ -607,7 +639,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
607
639
"vm.stat_interval" : "10" ,
608
640
}
609
641
kernelParameters = []string {noHzParam , "tsc=reliable" , "nosoftlockup" , "nmi_watchdog=0" , "mce=off" , "skew_tick=1" ,
610
- "processor.max_cstate=1" , "intel_idle.max_cstate=0" , " idle=poll" }
642
+ "processor.max_cstate=1" , "idle=poll" }
611
643
612
644
wg = sync.WaitGroup {}
613
645
By ("Waiting for TuneD to start on nodes" )
@@ -629,7 +661,9 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
629
661
fmt .Sprintf ("stalld is not running on %q when it should" , node .Name ))
630
662
631
663
By (fmt .Sprintf ("Checking TuneD parameters on %q" , node .Name ))
632
- kernelParameters = append (kernelParameters , utilstuned .AddPstateParameter (context .TODO (), node ))
664
+ if isIntel {
665
+ kernelParameters = append (kernelParameters , "intel_idle.max_cstate=0" , utilstuned .AddPstateParameter (context .TODO (), node ))
666
+ }
633
667
utilstuned .CheckParameters (context .TODO (), node , sysctlMap , kernelParameters , stalldEnabled , rtKernel )
634
668
}()
635
669
}
@@ -658,6 +692,10 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
658
692
var fullPath string = ""
659
693
// This test requires real hardware with powermanagement settings done on BIOS
660
694
// Using numa nodes to check if we are running on real hardware.
695
+
696
+ if isAMD {
697
+ Skip ("Crio Powersave annotations test can only be run on Intel systems" )
698
+ }
661
699
checkHardwareCapability (context .TODO (), workerRTNodes )
662
700
currentWorkloadHints := profile .Spec .WorkloadHints
663
701
profile .Spec .WorkloadHints = & performancev2.WorkloadHints {
@@ -756,10 +794,13 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
756
794
err = checkCpuGovernorsAndResumeLatency (context .TODO (), targetCpus , & workerRTNodes [0 ], "0" , "performance" )
757
795
})
758
796
759
- It ("[test_id:54186] Verify sysfs paramters of guaranteed pod with performance annotiations" , func () {
797
+ It ("[test_id:54186] Verify sysfs parameters of guaranteed pod with performance annotiations" , func () {
760
798
761
799
// This test requires real hardware with powermanagement settings done on BIOS
762
800
// Using numa nodes to check if we are running on real hardware
801
+ if isAMD {
802
+ Skip ("Crio Powersave annotations test can only be run on Intel systems" )
803
+ }
763
804
var containerCgroup , fullPath string
764
805
checkHardwareCapability (context .TODO (), workerRTNodes )
765
806
currentWorkloadHints := profile .Spec .WorkloadHints
0 commit comments