From c4fcb1e8cbf945be9556f63faadb1825de0f6a45 Mon Sep 17 00:00:00 2001 From: nikhiljindal Date: Thu, 5 Apr 2018 11:33:56 -0700 Subject: [PATCH] Updating kubemci remove-clusters e2e test to use --force to remove from all clusters --- test/e2e/network/ingress.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/e2e/network/ingress.go b/test/e2e/network/ingress.go index 4b673c0d70c..baf08c41f88 100644 --- a/test/e2e/network/ingress.go +++ b/test/e2e/network/ingress.go @@ -640,10 +640,15 @@ var _ = SIGDescribe("Loadbalancing: L7", func() { name := jig.Ingress.Name // Verify that the ingress is spread to 1 cluster as expected. verifyKubemciStatusHas(name, "is spread across 1 cluster") + // Validate that removing the ingress from all clusters throws an error. // Reuse the ingress file created while creating the ingress. filePath := filepath.Join(framework.TestContext.OutputDir, "mci.yaml") - if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err != nil { - framework.Failf("unexpected error in running kubemci remove-clusters: %s", err) + if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err == nil { + framework.Failf("expected non-nil error in running kubemci remove-clusters to remove from all clusters") + } + // remove-clusters should succeed with --force=true + if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath, "--force=true"); err != nil { + framework.Failf("unexpected error in running kubemci remove-clusters to remove from all clusters with --force=true: %s", err) } verifyKubemciStatusHas(name, "is spread across 0 cluster") })