Skip to content

Commit a9c528d

Browse files
committed
Make tls tests more stable
1 parent b84815f commit a9c528d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

test/extended-priv/controllerconfig.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type CertificateInfo struct {
2424
// signer is the cert Issuer
2525
Signer string `json:"signer"`
2626

27-
// Date fields have been temporarily removed by devs: https://github.com/openshift/machine-config-operator/pull/3866
2827
// notBefore is the lower boundary for validity
2928
NotBefore string `json:"notBefore"`
3029

test/extended-priv/mco_security.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,9 +1167,9 @@ func validateCorrectTLSProfileSecurity(oc *exutil.CLI, tlsSecurityProfile, tlsMi
11671167
exutil.By(fmt.Sprintf("To check the valid tls-min-version for %s in all MCS pods", tlsSecurityProfile))
11681168
for _, mcsPodName := range mcspod {
11691169
logger.Infof("Checking MCS pod: %s\n", mcsPodName)
1170-
mcsLogs, err := exutil.GetSpecificPodLogs(oc, MachineConfigNamespace, MachineConfigServer, mcsPodName, "")
1171-
o.Expect(err).NotTo(o.HaveOccurred())
1172-
o.Expect(mcsLogs).To(o.ContainSubstring(tlsMinVersionStr), "Error getting required tls-min-version for %s pod", mcsPodName)
1170+
o.Eventually(exutil.GetSpecificPodLogs, "3m", "10s").WithArguments(oc, MachineConfigNamespace, MachineConfigServer, mcsPodName, "").
1171+
Should(o.ContainSubstring(tlsMinVersionStr), "Error getting required tls-min-version for %s pod", mcsPodName)
1172+
11731173
}
11741174
logger.Infof("OK!\n")
11751175

@@ -1192,7 +1192,13 @@ func validateCorrectTLSProfileSecurity(oc *exutil.CLI, tlsSecurityProfile, tlsMi
11921192
exutil.By(fmt.Sprintf("To check the valid tls-cipher-suite for %s in all MCS pods", tlsSecurityProfile))
11931193
for _, mcsPodName := range mcspod {
11941194
logger.Infof("Checking MCS pod: %s\n", mcsPodName)
1195-
mcsLogs, err := exutil.GetSpecificPodLogs(oc, MachineConfigNamespace, MachineConfigServer, mcsPodName, "")
1195+
var mcsLogs string
1196+
o.Eventually(func() (string, error) {
1197+
var err error
1198+
mcsLogs, err = exutil.GetSpecificPodLogs(oc, MachineConfigNamespace, MachineConfigServer, mcsPodName, "")
1199+
return mcsLogs, err
1200+
}, "3m", "10s").ShouldNot(o.BeEmpty(), "Cannot get MCS logs")
1201+
11961202
o.Expect(err).NotTo(o.HaveOccurred())
11971203
for i := range cipherSuite {
11981204
o.Expect(mcsLogs).To(o.ContainSubstring(cipherSuite[i]), "Error getting %s cipher suite for given tlsSecuirtyProfile of %s pod", cipherSuite[i], mcsPodName)

0 commit comments

Comments
 (0)