From f1977c5e59eee22dcc658afe8bc24f7e1efaafab Mon Sep 17 00:00:00 2001 From: Joseph Palermo Date: Wed, 18 Jul 2018 11:09:52 -0700 Subject: [PATCH] Fix failover test to work with bosh dns Signed-off-by: Swati Soni --- cf-mysql-service/failover/failover_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cf-mysql-service/failover/failover_test.go b/cf-mysql-service/failover/failover_test.go index ef1c55a..07bc6b0 100644 --- a/cf-mysql-service/failover/failover_test.go +++ b/cf-mysql-service/failover/failover_test.go @@ -21,6 +21,7 @@ import ( "github.com/cloudfoundry-incubator/cf-test-helpers/generator" "github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests/helpers" + "strings" ) const ( @@ -100,9 +101,12 @@ func deleteMysqlVM(host string) error { var vmcid string for _, instance := range instances { - if instance.Group == "mysql" && instance.IPs[0] == host { - vmcid = instance.VMID - break + if instance.Group == "mysql" { + hostArray := strings.Split(host, ".") + if instance.IPs[0] == host || (len(hostArray) > 0 && hostArray[0] == instance.ID) { + vmcid = instance.VMID + break + } } }