From e083430c080e37df9bbe58526182fe7a0f77fd27 Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Mon, 17 Jul 2023 15:15:34 +0300 Subject: [PATCH] E2E: return error when the condition is not valid This was causing the tests not to catch errors. Signed-off-by: Federico Paolinelli --- e2etests/tests/validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2etests/tests/validate.go b/e2etests/tests/validate.go index f41a9b1f..17ccaada 100644 --- a/e2etests/tests/validate.go +++ b/e2etests/tests/validate.go @@ -49,7 +49,7 @@ func ValidatePrefixesForNeighbor(neigh frrcontainer.FRR, nodes []v1.Node, prefix found, err := routes.CheckNeighborHasPrefix(neigh, prefix, nodes) framework.ExpectNoError(err) if !found { - fmt.Errorf("Neigh %s does not have prefix %s", neigh.Name, prefix) + return fmt.Errorf("Neigh %s does not have prefix %s", neigh.Name, prefix) } } return nil @@ -63,7 +63,7 @@ func ValidateNeighborNoPrefixes(neigh frrcontainer.FRR, nodes []v1.Node, prefixe found, err := routes.CheckNeighborHasPrefix(neigh, prefix, nodes) framework.ExpectNoError(err) if found { - fmt.Errorf("Neigh %s has prefix %s", neigh.Name, prefix) + return fmt.Errorf("Neigh %s has prefix %s", neigh.Name, prefix) } } return nil