-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test that check nnce conditions to tolerate both failing and aborted conditions when invalid nncp is created Signed-off-by: Radim Hrazdil <[email protected]>
- Loading branch information
Radim Hrazdil
committed
Mar 16, 2021
1 parent
b9b1be6
commit b68843e
Showing
2 changed files
with
36 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,29 @@ func invalidConfig(bridgeName string) nmstate.State { | |
`, bridgeName)) | ||
} | ||
|
||
var _ = Describe("[rfe_id:3503][crit:medium][vendor:[email protected]][level:component]EnactmentCondition", func() { | ||
var _ = FDescribe("[rfe_id:3503][crit:medium][vendor:[email protected]][level:component]EnactmentCondition", func() { | ||
var abortedEnactmentConditions = []interface{}{ | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionFailing, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionAvailable, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionProgressing, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionMatching, | ||
Status: corev1.ConditionTrue, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionAborted, | ||
Status: corev1.ConditionTrue, | ||
}, | ||
} | ||
Context("when applying valid config", func() { | ||
BeforeEach(func() { | ||
}) | ||
|
@@ -143,7 +165,12 @@ var _ = Describe("[rfe_id:3503][crit:medium][vendor:[email protected]][level:com | |
It("[test_id:3795][parallel] should have Failing ConditionType set to true", func() { | ||
for _, node := range nodes { | ||
By(fmt.Sprintf("Check %s failing state is reached", node)) | ||
enactmentConditionsStatusEventually(node).Should(ConsistOf(failingEnactmentConditions...), "should eventually reach failing conditions at enactments") | ||
enactmentConditionsStatusEventually(node).Should( | ||
SatisfyAny( | ||
ConsistOf(failingEnactmentConditions...), | ||
ConsistOf(abortedEnactmentConditions...), | ||
), "should eventually reach failing or aborted conditions at enactments", | ||
) | ||
} | ||
By("Check policy is at degraded state") | ||
waitForDegradedTestPolicy() | ||
|
@@ -157,35 +184,18 @@ var _ = Describe("[rfe_id:3503][crit:medium][vendor:[email protected]][level:com | |
defer wg.Done() | ||
defer GinkgoRecover() | ||
By(fmt.Sprintf("Check %s failing state is kept", node)) | ||
enactmentConditionsStatusConsistently(node).Should(ConsistOf(failingEnactmentConditions...), "should consistently keep failing conditions at enactments") | ||
enactmentConditionsStatusConsistently(node).Should( | ||
SatisfyAny( | ||
ConsistOf(failingEnactmentConditions...), | ||
ConsistOf(abortedEnactmentConditions...), | ||
), "should consistently keep failing or aborted conditions at enactments", | ||
) | ||
}() | ||
} | ||
wg.Wait() | ||
}) | ||
|
||
It("[test_id:3795][sequential] should have one Failing the rest Aborted ConditionType set to true", func() { | ||
var abortedEnactmentConditions = []interface{}{ | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionFailing, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionAvailable, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionProgressing, | ||
Status: corev1.ConditionFalse, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionMatching, | ||
Status: corev1.ConditionTrue, | ||
}, | ||
shared.Condition{ | ||
Type: shared.NodeNetworkConfigurationEnactmentConditionAborted, | ||
Status: corev1.ConditionTrue, | ||
}, | ||
} | ||
checkEnactmentCounts := func(policy string) { | ||
failingConditions := 0 | ||
abortedConditions := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters