e2e: make ForEach fail if filter is empty, fix no-op tests

This commit is contained in:
Jeff Lowdermilk
2016-05-12 10:02:36 -07:00
parent 4aabafe4c3
commit 6a15e0a9c2
2 changed files with 19 additions and 6 deletions

View File

@@ -668,6 +668,9 @@ func (cl *ClusterVerification) WaitForOrFail(atLeast int, timeout time.Duration)
func (cl *ClusterVerification) ForEach(podFunc func(api.Pod)) error {
pods, err := cl.podState.filter(cl.client, cl.namespace)
if err == nil {
if len(pods) == 0 {
Failf("No pods matched the filter.")
}
Logf("ForEach: Found %v pods from the filter. Now looping through them.", len(pods))
for _, p := range pods {
podFunc(p)