@@ -25,7 +25,6 @@ import (
2525 "tests/helpers"
2626
2727 "github.com/stretchr/testify/require"
28- appsv1 "k8s.io/api/apps/v1"
2928 v1 "k8s.io/api/core/v1"
3029 "sigs.k8s.io/e2e-framework/pkg/envconf"
3130 "sigs.k8s.io/e2e-framework/pkg/features"
@@ -34,10 +33,9 @@ import (
3433type contextKey string
3534
3635const (
37- keySyslogNodeName contextKey = "nodeName"
38- keyStopChan contextKey = "stopChan"
39- keySyslogPodName contextKey = "syslogPodName"
40- keySyslogDaemonSet contextKey = "syslogDaemonSet"
36+ keySyslogNodeName contextKey = "nodeName"
37+ keyStopChan contextKey = "stopChan"
38+ keySyslogPodName contextKey = "syslogPodName"
4139)
4240
4341// TestSyslogHealthMonitorXIDDetection tests burst XID injection and aggregation
@@ -50,13 +48,12 @@ func TestSyslogHealthMonitorXIDDetection(t *testing.T) {
5048 client , err := c .NewClient ()
5149 require .NoError (t , err , "failed to create kubernetes client" )
5250
53- testNodeName , originalDaemonSet , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , false )
51+ testNodeName , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , nil )
5452 require .NoError (t , err , "failed to set up syslog health monitor" )
5553
5654 ctx = context .WithValue (ctx , keySyslogNodeName , testNodeName )
5755 ctx = context .WithValue (ctx , keySyslogPodName , syslogPod .Name )
5856 ctx = context .WithValue (ctx , keyStopChan , stopChan )
59- ctx = context .WithValue (ctx , keySyslogDaemonSet , originalDaemonSet )
6057
6158 return ctx
6259 })
@@ -165,11 +162,10 @@ func TestSyslogHealthMonitorXIDDetection(t *testing.T) {
165162 require .NoError (t , err , "failed to create kubernetes client" )
166163
167164 nodeName := ctx .Value (keySyslogNodeName ).(string )
168- originalDaemonSet := ctx .Value (keySyslogDaemonSet ).(* appsv1.DaemonSet )
169165 syslogPod := ctx .Value (keySyslogPodName ).(string )
170166 stopChan := ctx .Value (keyStopChan ).(chan struct {})
171167
172- helpers .TearDownSyslogHealthMonitor (ctx , t , client , originalDaemonSet , nodeName , stopChan , false , syslogPod )
168+ helpers .TearDownSyslogHealthMonitor (ctx , t , client , nodeName , stopChan , nil , syslogPod )
173169
174170 return ctx
175171 })
@@ -301,10 +297,9 @@ func TestSyslogHealthMonitorSXIDDetection(t *testing.T) {
301297 client , err := c .NewClient ()
302298 require .NoError (t , err , "failed to create kubernetes client" )
303299
304- testNodeName , originalDaemonSet , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , false )
300+ testNodeName , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , nil )
305301
306302 ctx = context .WithValue (ctx , keySyslogNodeName , testNodeName )
307- ctx = context .WithValue (ctx , keySyslogDaemonSet , originalDaemonSet )
308303 ctx = context .WithValue (ctx , keySyslogPodName , syslogPod .Name )
309304 ctx = context .WithValue (ctx , keyStopChan , stopChan )
310305 return ctx
@@ -354,10 +349,9 @@ func TestSyslogHealthMonitorSXIDDetection(t *testing.T) {
354349
355350 nodeName := ctx .Value (keySyslogNodeName ).(string )
356351 stopChan := ctx .Value (keyStopChan ).(chan struct {})
357- originalDaemonSet := ctx .Value (keySyslogDaemonSet ).(* appsv1.DaemonSet )
358352 syslogPod := ctx .Value (keySyslogPodName ).(string )
359353
360- helpers .TearDownSyslogHealthMonitor (ctx , t , client , originalDaemonSet , nodeName , stopChan , false , syslogPod )
354+ helpers .TearDownSyslogHealthMonitor (ctx , t , client , nodeName , stopChan , nil , syslogPod )
361355
362356 return ctx
363357 })
@@ -375,16 +369,17 @@ func TestSyslogHealthMonitorStoreOnlyStrategy(t *testing.T) {
375369 client , err := c .NewClient ()
376370 require .NoError (t , err , "failed to create kubernetes client" )
377371
378- testNodeName , originalDaemonSet , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , true )
372+ testNodeName , syslogPod , stopChan := helpers .SetUpSyslogHealthMonitor (ctx , t , client , map [string ]string {
373+ "--processing-strategy" : "STORE_ONLY" ,
374+ })
379375
380376 ctx = context .WithValue (ctx , keySyslogNodeName , testNodeName )
381377 ctx = context .WithValue (ctx , keyStopChan , stopChan )
382378 ctx = context .WithValue (ctx , keySyslogPodName , syslogPod .Name )
383- ctx = context .WithValue (ctx , keySyslogDaemonSet , originalDaemonSet )
384379 return ctx
385380 })
386381
387- feature .Assess ("Inject XID errors and verify GPU lookup via NVSwitch topology " , func (ctx context.Context , t * testing.T , c * envconf.Config ) context.Context {
382+ feature .Assess ("Inject XID errors and verify no node condition is created when running in STORE_ONLY strategy " , func (ctx context.Context , t * testing.T , c * envconf.Config ) context.Context {
388383 client , err := c .NewClient ()
389384 require .NoError (t , err , "failed to create kubernetes client" )
390385
@@ -396,10 +391,10 @@ func TestSyslogHealthMonitorStoreOnlyStrategy(t *testing.T) {
396391
397392 helpers .InjectSyslogMessages (t , helpers .StubJournalHTTPPort , xidMessages )
398393
399- t .Log ("Verifying no node condition is created when processing STORE_ONLY strategy " )
394+ t .Log ("Verifying no node condition is created" )
400395 helpers .EnsureNodeConditionNotPresent (ctx , t , client , nodeName , "SysLogsXIDError" )
401396
402- t .Log ("Verifying node was not cordoned when processing STORE_ONLY strategy " )
397+ t .Log ("Verifying node was not cordoned" )
403398 helpers .AssertQuarantineState (ctx , t , client , nodeName , helpers.QuarantineAssertion {
404399 ExpectCordoned : false ,
405400 ExpectAnnotation : false ,
@@ -411,12 +406,14 @@ func TestSyslogHealthMonitorStoreOnlyStrategy(t *testing.T) {
411406 feature .Teardown (func (ctx context.Context , t * testing.T , c * envconf.Config ) context.Context {
412407 client , err := c .NewClient ()
413408 require .NoError (t , err , "failed to create kubernetes client" )
409+
414410 nodeName := ctx .Value (keySyslogNodeName ).(string )
415411 stopChan := ctx .Value (keyStopChan ).(chan struct {})
416412 syslogPod := ctx .Value (keySyslogPodName ).(string )
417413
418- originalDaemonSet := ctx .Value (keySyslogDaemonSet ).(* appsv1.DaemonSet )
419- helpers .TearDownSyslogHealthMonitor (ctx , t , client , originalDaemonSet , nodeName , stopChan , true , syslogPod )
414+ helpers .TearDownSyslogHealthMonitor (ctx , t , client , nodeName , stopChan , map [string ]string {
415+ "--processing-strategy" : "EXECUTE_REMEDIATION" ,
416+ }, syslogPod )
420417
421418 return ctx
422419 })
0 commit comments