Skip to content

Commit 3e034f5

Browse files
tests: update ImageModeStatusReporting regression tests for split applied OS and file conditions
1 parent 70c890b commit 3e034f5

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

test/extended/machineconfignode.go

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,27 +235,40 @@ func ValidateTransitionThroughConditions(machineConfigClient *machineconfigclien
235235
o.Expect(conditionMet).To(o.BeTrue(), "Error, could not detect Drained=True.")
236236
}
237237

238-
logger.Infof("Waiting for AppliedFilesAndOS=Unknown")
239-
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateFilesAndOS, metav1.ConditionUnknown, 30*time.Second, 1*time.Second)
240-
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedFilesAndOS=Unknown: %v", err))
241-
if !conditionMet {
242-
logger.Infof("Warning, could not detect AppliedFilesAndOS=Unknown.")
243-
}
244-
245-
// On image mode update, check that node transitions through the "ImagePulledFromRegistry" phase
238+
// On image mode update, check that node transitions through the "AppliedOSImage" and
239+
// "ImagePulledFromRegistry" phases
246240
if isImageMode {
241+
logger.Infof("Waiting for AppliedOSImage=Unknown")
242+
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateOS, metav1.ConditionUnknown, 30*time.Second, 1*time.Second)
243+
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedOSImage=Unknown: %v", err))
244+
if !conditionMet {
245+
logger.Infof("Warning, could not detect AppliedOSImage=Unknown.")
246+
}
247+
247248
logger.Infof("Waiting for ImagePulledFromRegistry=Unknown")
248249
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeImagePulledFromRegistry, metav1.ConditionUnknown, 30*time.Second, 1*time.Second)
249250
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for ImagePulledFromRegistry=Unknown: %v", err))
250251
if !conditionMet {
251252
logger.Infof("Warning, could not detect ImagePulledFromRegistry=Unknown.")
252253
}
253-
}
254254

255-
logger.Infof("Waiting for AppliedFilesAndOS=True")
256-
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateFilesAndOS, metav1.ConditionTrue, 3*time.Minute, 1*time.Second)
257-
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedFilesAndOS=True: %v", err))
258-
o.Expect(conditionMet).To(o.BeTrue(), "Error, could not detect AppliedFilesAndOS=True.")
255+
logger.Infof("Waiting for AppliedOSImage=True")
256+
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateOS, metav1.ConditionTrue, 3*time.Minute, 1*time.Second)
257+
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedOSImage=True: %v", err))
258+
o.Expect(conditionMet).To(o.BeTrue(), "Error, could not detect AppliedOSImage=True.")
259+
} else { // On a non-image mode update, check that node transitions through the "AppliedFiles" phase
260+
logger.Infof("Waiting for AppliedFiles=Unknown")
261+
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateFiles, metav1.ConditionUnknown, 30*time.Second, 1*time.Second)
262+
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedFiles=Unknown: %v", err))
263+
if !conditionMet {
264+
logger.Infof("Warning, could not detect AppliedFiles=Unknown.")
265+
}
266+
267+
logger.Infof("Waiting for AppliedFiles=True")
268+
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateFiles, metav1.ConditionTrue, 3*time.Minute, 1*time.Second)
269+
o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("Error occurred while waiting for AppliedFiles=True: %v", err))
270+
o.Expect(conditionMet).To(o.BeTrue(), "Error, could not detect AppliedFiles=True.")
271+
}
259272

260273
logger.Infof("Waiting for UpdateExecuted=True")
261274
conditionMet, err = waitForMCNConditionStatus(machineConfigClient, updatingNodeName, mcfgv1.MachineConfigNodeUpdateExecuted, metav1.ConditionTrue, 20*time.Second, 1*time.Second)

0 commit comments

Comments
 (0)