@@ -99,12 +99,10 @@ var _ = g.Describe("[sig-mco][OCPFeatureGate:MachineConfigNodes]", func() {
9999 })
100100
101101 g .It ("Should properly block MCN updates by impersonation of the MCD SA [apigroup:machineconfiguration.openshift.io]" , func () {
102- skipOnSingleNodeTopology (oc ) //skip this test for SNO
103102 ValidateMCNScopeImpersonationPathTest (oc )
104103 })
105104
106105 g .It ("Should properly update the MCN from the associated MCD [apigroup:machineconfiguration.openshift.io]" , func () {
107- skipOnSingleNodeTopology (oc ) //skip this test for SNO
108106 ValidateMCNScopeHappyPathTest (oc )
109107 })
110108})
@@ -571,7 +569,7 @@ func ValidateMCNScopeSadPathTest(oc *exutil.CLI) {
571569 // Grab two different nodes, so we don't end up testing and targeting the same node.
572570 nodeUnderTest := nodes [0 ]
573571 targetNode := nodes [1 ]
574- framework .Logf ("Testing with nodes '%v' and '%v'." , nodeUnderTest , targetNode )
572+ framework .Logf ("Testing with nodes '%v' and '%v'." , nodeUnderTest . Name , targetNode . Name )
575573
576574 // Attempt to patch the MCN owned by targetNode from nodeUnderTest's MCD. This should fail.
577575 // This oc command effectively use the service account of the nodeUnderTest's MCD pod, which should only be able to edit nodeUnderTest's MCN.
@@ -584,9 +582,10 @@ func ValidateMCNScopeSadPathTest(oc *exutil.CLI) {
584582
585583// `ValidateMCNScopeImpersonationPathTest` checks that MCN updates by impersonation of the MCD SA are blocked
586584func ValidateMCNScopeImpersonationPathTest (oc * exutil.CLI ) {
587- // Grab a random node from the worker pool
585+ // Grab a random node with a worker role
588586 nodeUnderTest := GetRandomNode (oc , "worker" )
589- framework .Logf ("Testing with node '%v'." , nodeUnderTest )
587+ o .Expect (nodeUnderTest .Name ).NotTo (o .Equal ("" ), "Could not get a `worker` node." )
588+ framework .Logf ("Testing with node '%v'." , nodeUnderTest .Name )
590589
591590 var errb bytes.Buffer
592591 // Attempt to patch the MCN owned by nodeUnderTest by impersonating the MCD SA. This should fail.
@@ -602,17 +601,18 @@ func ValidateMCNScopeImpersonationPathTest(oc *exutil.CLI) {
602601
603602// `ValidateMCNScopeHappyPathTest` checks that MCN updates from the associated MCD are allowed
604603func ValidateMCNScopeHappyPathTest (oc * exutil.CLI ) {
605- // Grab a random node from the worker pool
604+ // Grab a random node with a worker role
606605 nodeUnderTest := GetRandomNode (oc , "worker" )
607- framework .Logf ("Testing with node '%v'." , nodeUnderTest )
606+ o .Expect (nodeUnderTest .Name ).NotTo (o .Equal ("" ), "Could not get a `worker` node." )
607+ framework .Logf ("Testing with node '%v'." , nodeUnderTest .Name )
608608
609609 // Get node's starting desired version
610610 nodeDesiredConfig := nodeUnderTest .Annotations [desiredConfigAnnotationKey ]
611611
612612 // Attempt to patch the MCN owned by nodeUnderTest from nodeUnderTest's MCD. This should succeed.
613613 // This oc command effectively use the service account of the nodeUnderTest's MCD pod, which should only be able to edit nodeUnderTest's MCN.
614614 ExecCmdOnNode (oc , nodeUnderTest , "chroot" , "/rootfs" , "oc" , "patch" , "machineconfignodes" , nodeUnderTest .Name , "--type=merge" , "-p" , "{\" spec\" :{\" configVersion\" :{\" desired\" :\" rendered-worker-test\" }}}" )
615- framework .Logf ("MCN '%v' patched successfully." , nodeUnderTest )
615+ framework .Logf ("MCN '%v' patched successfully." , nodeUnderTest . Name )
616616
617617 // Cleanup by updating the MCN desired config back to the original value.
618618 framework .Logf ("Cleaning up patched MCN's desired config value." )
0 commit comments