mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-18 07:18:27 +00:00
katatestutils: Reset TestConstraints fields on NotValid() call
`TestConstraint.NotValid()` is really designed to be called once per test. However, there is no reason it should not be possible to call multiple times. But to allow for that secenario, any settings from a previous `NotValid()` call need to be cleared. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -112,6 +112,11 @@ func (tc *TestConstraint) NotValid(constraints ...Constraint) bool {
|
||||
panic("need atleast one constraint")
|
||||
}
|
||||
|
||||
// Reset in case of a previous call
|
||||
tc.Passed = nil
|
||||
tc.Failed = nil
|
||||
tc.Issue = ""
|
||||
|
||||
for _, c := range constraints {
|
||||
invalid := tc.constraintInvalid(c)
|
||||
if invalid {
|
||||
|
Reference in New Issue
Block a user