Skip to content

Commit

Permalink
Merge pull request #995 from skmatti/e2e-test-fix
Browse files Browse the repository at this point in the history
Make frontend resource deletion test verify that ingress VIP is unchanged
  • Loading branch information
k8s-ci-robot authored Jan 23, 2020
2 parents c0fef63 + 8a4a0e8 commit 50924ce
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions cmd/e2e-test/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,42 @@ func TestFrontendResourceDeletion(t *testing.T) {
if gclb, err = e2e.WhiteboxTest(ing, s, Framework.Cloud, ""); err != nil {
t.Fatalf("e2e.WhiteboxTest(%s, ...) = %v, want nil", ingKey, err)
}

expectedVIP := ing.Status.LoadBalancer.Ingress[0].IP
// Re-enable http/https and verify that the ingress uses same VIP.
if ing, err = crud.Get(ing.Namespace, ing.Name); err != nil {
t.Fatalf("crud.Get(%s) = %v, want nil", ingKey, err)
}
ingBuilder = fuzz.NewIngressBuilderFromExisting(ing)
if tc.disableHTTP {
ingBuilder = ingBuilder.SetAllowHttp(true)
}
if tc.disableHTTPS {
ingBuilder.SetTLS([]v1beta1.IngressTLS{
{
Hosts: []string{},
SecretName: cert.Name,
},
})
}
ing = ingBuilder.Build()
if _, err := crud.Update(ing); err != nil {
t.Fatalf("Update(%s) = %v, want nil; ingress: %v", ingKey, err, ing)
}
t.Logf("Ingress updated (%s)", ingKey)
if ing, err = e2e.WaitForIngress(s, ing, &e2e.WaitForIngressOptions{ExpectUnreachable: true}); err != nil {
t.Fatalf("error waiting for Ingress %s to stabilize: %v", ingKey, err)
}
gclb, err = e2e.WhiteboxTest(ing, s, Framework.Cloud, "")
if err != nil {
t.Fatalf("e2e.WhiteboxTest(%s, ...)", ingKey)
}
// Verify that ingress VIP is retained.
gotVIP := ing.Status.LoadBalancer.Ingress[0].IP
if expectedVIP != gotVIP {
t.Fatalf("Two separate VIPs are created. expected %s, got %s", expectedVIP, gotVIP)
}

deleteOptions = &fuzz.GCLBDeleteOptions{
SkipDefaultBackend: true,
}
Expand Down

0 comments on commit 50924ce

Please sign in to comment.