Skip to content

Commit 918f338

Browse files
Merge pull request #29745 from RishabhSaini/pisMetal
OCPBUGS-55394: Handle Metal CI test cases for PIS
2 parents 4fdbdce + cd52832 commit 918f338

File tree

2 files changed

+269
-92
lines changed

2 files changed

+269
-92
lines changed

test/extended/machine_config/helpers.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,25 @@ func IsTwoNodeArbiter(oc *exutil.CLI) bool {
126126
infra.Status.InfrastructureTopology == osconfigv1.HighlyAvailableTopologyMode
127127
}
128128

129-
// skipOnMetal skips the test if the cluster is using Metal PLatform
130-
func skipOnMetal(oc *exutil.CLI) {
129+
// `IsDisconnected` returns true if the cluster is a Disconnected cluster and false otherwise
130+
func IsDisconnected(oc *exutil.CLI, nodeName string) bool {
131+
networkStatus, _ := exutil.DebugNodeRetryWithOptionsAndChroot(oc, nodeName, "openshift-machine-config-operator", "systemctl", "is-active", "NetworkManager-wait-online.service")
132+
if networkStatus == "active" {
133+
return false
134+
}
135+
return true
136+
}
137+
138+
// `IsMetal` returns true if the cluster is hosted on a Metal Platform and false otherwise
139+
func IsMetal(oc *exutil.CLI) bool {
131140
infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
132141
o.Expect(err).NotTo(o.HaveOccurred())
133-
if infra.Status.Platform == osconfigv1.BareMetalPlatformType {
142+
return infra.Status.Platform == osconfigv1.BareMetalPlatformType
143+
}
144+
145+
// skipOnMetal skips the test if the cluster is using Metal PLatform
146+
func skipOnMetal(oc *exutil.CLI) {
147+
if IsMetal(oc) {
134148
e2eskipper.Skipf("This test does not apply to metal")
135149
}
136150
}

0 commit comments

Comments
 (0)