Skip to content

Commit

Permalink
e2e: utils: more log for failure conditions
Browse files Browse the repository at this point in the history
explain all the failure conditions when validating NRT objects.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Jun 15, 2022
1 parent 7e38bdb commit 2004cc7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/e2e/utils/nodetopology/nodetopology.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func IsValidNodeTopology(nodeTopology *v1alpha1.NodeResourceTopology, tmPolicy s
}

if nodeTopology.TopologyPolicies[0] != tmPolicy {
framework.Logf("topology mismatch got %q expected %q", nodeTopology.TopologyPolicies[0], tmPolicy)
return false
}

Expand All @@ -68,14 +69,20 @@ func IsValidNodeTopology(nodeTopology *v1alpha1.NodeResourceTopology, tmPolicy s
foundNodes++

if !IsValidCostList(zone.Name, zone.Costs) {
framework.Logf("invalid cost list for %q %q", nodeTopology.Name, zone.Name)
return false
}

if !IsValidResourceList(zone.Name, zone.Resources) {
framework.Logf("invalid resource list for %q %q", nodeTopology.Name, zone.Name)
return false
}
}
return foundNodes > 0
ret := foundNodes > 0
if !ret {
framework.Logf("found no Zone with 'node' kind for %q", nodeTopology.Name)
}
return ret
}

func IsValidCostList(zoneName string, costs v1alpha1.CostList) bool {
Expand Down

0 comments on commit 2004cc7

Please sign in to comment.