otherCertPath, err := testhelpers.WriteContentsToTempFile(testhelpers.OTHER_BBL_CERT) Expect(err).NotTo(HaveOccurred()) otherKeyPath, err := testhelpers.WriteContentsToTempFile(testhelpers.OTHER_BBL_KEY) Expect(err).NotTo(HaveOccurred()) bbl.CreateLB("concourse", certPath, keyPath, chainPath) Expect(aws.LoadBalancers(stackName)).To(HaveKey("ConcourseLoadBalancer")) Expect(strings.TrimSpace(aws.DescribeCertificate(state.CertificateName()).Body)).To(Equal(strings.TrimSpace(testhelpers.BBL_CERT))) bbl.UpdateLB(otherCertPath, otherKeyPath) Expect(aws.LoadBalancers(stackName)).To(HaveKey("ConcourseLoadBalancer")) certificateName := state.CertificateName() Expect(strings.TrimSpace(aws.DescribeCertificate(certificateName).Body)).To(Equal(strings.TrimSpace(string(testhelpers.OTHER_BBL_CERT)))) session := bbl.LBs() stdout := session.Out.Contents() Expect(stdout).To(ContainSubstring(fmt.Sprintf("Concourse LB: %s", aws.LoadBalancers(stackName)["ConcourseLoadBalancer"]))) bbl.DeleteLB() Expect(aws.LoadBalancers(stackName)).NotTo(HaveKey("ConcourseLoadBalancer")) Expect(strings.TrimSpace(aws.DescribeCertificate(certificateName).Body)).To(BeEmpty()) bbl.Destroy() Expect(bosh.DirectorExists(directorAddress, directorUsername, directorPassword)).To(BeFalse()) Expect(aws.StackExists(stackName)).To(BeFalse()) }) })