diff --git a/src/acceptance-tests/testing/helpers/deploy_turbulence.go b/src/acceptance-tests/testing/helpers/deploy_turbulence.go index 01ca6d1..c6a8dab 100644 --- a/src/acceptance-tests/testing/helpers/deploy_turbulence.go +++ b/src/acceptance-tests/testing/helpers/deploy_turbulence.go @@ -88,15 +88,15 @@ func DeployTurbulence(client bosh.Client, config Config) (turbulence.Manifest, e iaasConfig = awsConfig case "warden_cpi": + iaasConfig = iaas.NewWardenConfig() + var cidrBlock string - cidrPool := NewCIDRPool("10.244.4.0", 24, 27) - cidrBlock, err = cidrPool.Get(ginkgoConfig.GinkgoConfig.ParallelNode - 1) + cidrPool := core.NewCIDRPool("10.244.16.0", 24, 27) + cidrBlock, err = cidrPool.Get(ginkgoConfig.GinkgoConfig.ParallelNode) if err != nil { return turbulence.Manifest{}, err } - manifestConfig.IPRange = cidrBlock - iaasConfig = iaas.NewWardenConfig() default: return turbulence.Manifest{}, errors.New("unknown infrastructure type") } diff --git a/src/acceptance-tests/turbulence/kill_vm_test.go b/src/acceptance-tests/turbulence/kill_vm_test.go index fe6b367..5e6b345 100644 --- a/src/acceptance-tests/turbulence/kill_vm_test.go +++ b/src/acceptance-tests/turbulence/kill_vm_test.go @@ -16,7 +16,7 @@ import ( . "github.com/onsi/gomega" ) -var _ = PDescribe("KillVm", func() { +var _ = Describe("KillVm", func() { KillVMTest := func(enableSSL bool) { var ( turbulenceManifest turbulence.Manifest @@ -65,7 +65,17 @@ var _ = PDescribe("KillVm", func() { AfterEach(func() { By("deleting the deployment", func() { if !CurrentGinkgoTestDescription().Failed { - err := boshClient.DeleteDeployment(etcdManifest.Name) + yaml, err := etcdManifest.ToYAML() + Expect(err).NotTo(HaveOccurred()) + + Eventually(func() error { + return boshClient.ScanAndFixAll(yaml) + }, "5m", "1m").ShouldNot(HaveOccurred()) + + err = boshClient.DeleteDeployment(etcdManifest.Name) + Expect(err).NotTo(HaveOccurred()) + + err = boshClient.DeleteDeployment(turbulenceManifest.Name) Expect(err).NotTo(HaveOccurred()) } }) @@ -98,8 +108,9 @@ var _ = PDescribe("KillVm", func() { yaml, err := etcdManifest.ToYAML() Expect(err).NotTo(HaveOccurred()) - err = boshClient.ScanAndFixAll(yaml) - Expect(err).NotTo(HaveOccurred()) + Eventually(func() error { + return boshClient.ScanAndFixAll(yaml) + }, "5m", "1m").ShouldNot(HaveOccurred()) Eventually(func() ([]bosh.VM, error) { return helpers.DeploymentVMs(boshClient, etcdManifest.Name) diff --git a/src/acceptance-tests/turbulence/turbulence_suite_test.go b/src/acceptance-tests/turbulence/turbulence_suite_test.go index f39ca96..81848af 100644 --- a/src/acceptance-tests/turbulence/turbulence_suite_test.go +++ b/src/acceptance-tests/turbulence/turbulence_suite_test.go @@ -2,15 +2,10 @@ package turbulence_test import ( "acceptance-tests/testing/helpers" - "errors" "fmt" - "time" - ginkgoConfig "github.com/onsi/ginkgo/config" "github.com/pivotal-cf-experimental/bosh-test/bosh" turbulenceclient "github.com/pivotal-cf-experimental/bosh-test/turbulence" - "github.com/pivotal-cf-experimental/destiny/core" - "github.com/pivotal-cf-experimental/destiny/iaas" "github.com/pivotal-cf-experimental/destiny/turbulence" . "github.com/onsi/ginkgo" @@ -45,98 +40,4 @@ var _ = BeforeSuite(func() { Password: config.BOSH.Password, AllowInsecureSSL: true, }) - - By("deploying turbulence", func() { - info, err := boshClient.Info() - Expect(err).NotTo(HaveOccurred()) - - guid, err := helpers.NewGUID() - Expect(err).NotTo(HaveOccurred()) - - manifestConfig := turbulence.Config{ - DirectorUUID: info.UUID, - Name: "turbulence-etcd-" + guid, - BOSH: turbulence.ConfigBOSH{ - Target: config.BOSH.Target, - Username: config.BOSH.Username, - Password: config.BOSH.Password, - DirectorCACert: config.BOSH.DirectorCACert, - }, - } - - var iaasConfig iaas.Config - switch info.CPI { - case "aws_cpi": - manifestConfig.IPRange = "10.0.16.0/24" - awsConfig := iaas.AWSConfig{ - AccessKeyID: config.AWS.AccessKeyID, - SecretAccessKey: config.AWS.SecretAccessKey, - DefaultKeyName: config.AWS.DefaultKeyName, - DefaultSecurityGroups: config.AWS.DefaultSecurityGroups, - Region: config.AWS.Region, - RegistryHost: config.Registry.Host, - RegistryPassword: config.Registry.Password, - RegistryPort: config.Registry.Port, - RegistryUsername: config.Registry.Username, - } - if config.AWS.Subnet == "" { - err = errors.New("AWSSubnet is required for AWS IAAS deployment") - return - } - var cidrBlock string - cidrPool := core.NewCIDRPool("10.0.16.0", 24, 27) - cidrBlock, err = cidrPool.Get(ginkgoConfig.GinkgoConfig.ParallelNode) - if err != nil { - return - } - - manifestConfig.IPRange = cidrBlock - awsConfig.Subnets = []iaas.AWSConfigSubnet{{ID: config.AWS.Subnet, Range: cidrBlock, AZ: "us-east-1a"}} - - iaasConfig = awsConfig - case "warden_cpi": - iaasConfig = iaas.NewWardenConfig() - manifestConfig.IPRange = "10.244.16.0/24" - default: - Fail("unknown infrastructure type") - } - - turbulenceManifest, err = turbulence.NewManifest(manifestConfig, iaasConfig) - Expect(err).NotTo(HaveOccurred()) - - yaml, err := turbulenceManifest.ToYAML() - Expect(err).NotTo(HaveOccurred()) - - yaml, err = boshClient.ResolveManifestVersions(yaml) - Expect(err).NotTo(HaveOccurred()) - - turbulenceManifest, err = turbulence.FromYAML(yaml) - Expect(err).NotTo(HaveOccurred()) - - _, err = boshClient.Deploy(yaml) - Expect(err).NotTo(HaveOccurred()) - - Eventually(func() ([]bosh.VM, error) { - return helpers.DeploymentVMs(boshClient, turbulenceManifest.Name) - }, "1m", "10s").Should(ConsistOf([]bosh.VM{ - {Index: 0, JobName: "api", State: "running"}, - })) - }) - - By("preparing turbulence client", func() { - turbulenceUrl := fmt.Sprintf("https://turbulence:%s@%s:8080", - turbulenceManifest.Properties.TurbulenceAPI.Password, - turbulenceManifest.Jobs[0].Networks[0].StaticIPs[0]) - - turbulenceClient = turbulenceclient.NewClient(turbulenceUrl, 5*time.Minute, 2*time.Second) - }) -}) - -var _ = AfterSuite(func() { - By("deleting the turbulence deployment", func() { - if !CurrentGinkgoTestDescription().Failed { - err := boshClient.DeleteDeployment(turbulenceManifest.Name) - Expect(err).NotTo(HaveOccurred()) - } - }) }) diff --git a/src/acceptance-tests/vendor/github.com/pivotal-cf-experimental/destiny b/src/acceptance-tests/vendor/github.com/pivotal-cf-experimental/destiny index a499d86..79af461 160000 --- a/src/acceptance-tests/vendor/github.com/pivotal-cf-experimental/destiny +++ b/src/acceptance-tests/vendor/github.com/pivotal-cf-experimental/destiny @@ -1 +1 @@ -Subproject commit a499d86c506aed776b0fafc510fc31569ba6d6a5 +Subproject commit 79af461f6c7a0158acbb34b1d46cf5f59c31bd94