Remove most of the time.Sleep from the e2e tests

This commit is contained in:
Manuel de Brito Fontes 2018-04-18 16:15:08 -03:00
parent c3ff76ae50
commit 62a80a39ad
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
30 changed files with 628 additions and 465 deletions

View file

@ -47,3 +47,26 @@ func (f *Framework) ExecCommand(pod *v1.Pod, command string) (string, error) {
return execOut.String(), nil
}
// NewIngressController deploys a new NGINX Ingress controller in a namespace
func (f *Framework) NewIngressController(namespace string) error {
var (
execOut bytes.Buffer
execErr bytes.Buffer
)
cmd := exec.Command("test/e2e/wait-for-nginx.sh", namespace)
cmd.Stdout = &execOut
cmd.Stderr = &execErr
err := cmd.Run()
if err != nil {
return fmt.Errorf("could not execute: %v", err)
}
if execErr.Len() > 0 {
return fmt.Errorf("stderr: %v", execErr.String())
}
return nil
}