@@ -27,6 +27,8 @@ const LgpoUrl = "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FF
2727const lgpoFile = "LGPO.exe"
2828const redeployRetries = 10
2929
30+ const windowsVersion = "windows-2019"
31+
3032var (
3133 boshCommand * BoshCommand
3234 deploymentName string
@@ -59,7 +61,7 @@ var _ = BeforeSuite(func() {
5961
6062 err = boshCommand .Run ("login" )
6163 Expect (err ).NotTo (HaveOccurred ())
62- deploymentName = fmt . Sprintf ( "windows -acceptance-test-%d" , getTimestampInMs () )
64+ deploymentName = buildDeploymentName ( "stemcell -acceptance-test" )
6365
6466 stemcellYML , err := fetchStemcellInfo (testConfig .StemcellPath )
6567 Expect (err ).NotTo (HaveOccurred ())
@@ -88,7 +90,7 @@ var _ = AfterSuite(func() {
8890 return
8991 }
9092
91- err := boshCommand .Run (fmt .Sprintf ("-d %s delete-deployment --force" , deploymentName ))
93+ err := boshCommand .Run (fmt .Sprintf ("--deployment= %s delete-deployment --force" , deploymentName ))
9294 Expect (err ).NotTo (HaveOccurred ())
9395 err = boshCommand .Run (fmt .Sprintf ("delete-stemcell %s/%s" , stemcellName , stemcellVersion ))
9496 Expect (err ).NotTo (HaveOccurred ())
@@ -167,7 +169,7 @@ var _ = Describe("BOSH Windows", func() {
167169 var slowCompilingDeploymentName string
168170
169171 AfterEach (func () {
170- err := boshCommand .Run (fmt .Sprintf ("-d %s delete-deployment --force" , slowCompilingDeploymentName ))
172+ err := boshCommand .Run (fmt .Sprintf ("--deployment= %s delete-deployment --force" , slowCompilingDeploymentName ))
171173 Expect (err ).NotTo (HaveOccurred ())
172174 })
173175
@@ -176,7 +178,7 @@ var _ = Describe("BOSH Windows", func() {
176178 Expect (err ).NotTo (HaveOccurred ())
177179 manifestPath = filepath .Join (pwd , "assets" , "slow-compile-manifest.yml" )
178180
179- slowCompilingDeploymentName = fmt . Sprintf ( "windows -acceptance-test-slow-compile-%d" , getTimestampInMs () )
181+ slowCompilingDeploymentName = buildDeploymentName ( "stemcell -acceptance-test-slow-compile" )
180182
181183 err = testConfig .deployWithManifest (boshCommand , slowCompilingDeploymentName , stemcellVersion , releaseVersion , manifestPath )
182184 Expect (err ).NotTo (HaveOccurred ())
@@ -185,12 +187,12 @@ var _ = Describe("BOSH Windows", func() {
185187
186188 Context ("ssh enabled" , func () {
187189 It ("allows SSH connection" , func () {
188- err := boshCommand .Run (fmt .Sprintf ("-d %s ssh --opts=-T --command=exit" , deploymentName ))
190+ err := boshCommand .Run (fmt .Sprintf ("--deployment= %s ssh --opts=-T --command=exit" , deploymentName ))
189191 Expect (err ).NotTo (HaveOccurred ())
190192 })
191193
192194 It ("cleans up ssh users after a successful connection" , func () {
193- err := boshCommand .Run (fmt .Sprintf ("-d %s ssh --opts=-T --command=exit" , deploymentName ))
195+ err := boshCommand .Run (fmt .Sprintf ("--deployment= %s ssh --opts=-T --command=exit" , deploymentName ))
194196 Expect (err ).NotTo (HaveOccurred ())
195197
196198 err = boshCommand .RunErrand ("check-ssh" , deploymentName ) // test for C:\Users only having one ssh user, net users only containing one ssh user.
@@ -199,6 +201,14 @@ var _ = Describe("BOSH Windows", func() {
199201 })
200202})
201203
204+ func buildDeploymentName (baseName string ) string {
205+ return fmt .Sprintf ("%s-%s-%d" , windowsVersion , baseName , getTimestampInMs ())
206+ }
207+
208+ func getTimestampInMs () int64 {
209+ return time .Now ().UTC ().UnixNano () / int64 (time .Millisecond )
210+ }
211+
202212type TestConfig struct {
203213 Bosh struct {
204214 CaCert string `json:"ca_cert"`
@@ -222,10 +232,6 @@ type TestConfig struct {
222232 SecurityComplianceApplied bool `json:"security_compliance_applied"`
223233}
224234
225- func getTimestampInMs () int64 {
226- return time .Now ().UTC ().UnixNano () / int64 (time .Millisecond )
227- }
228-
229235type StemcellYML struct {
230236 Version string `yaml:"version"`
231237 Name string `yaml:"name"`
@@ -508,7 +514,7 @@ func downloadLogs(instanceName string, jobName string, index int, bosh *BoshComm
508514 Expect (err ).NotTo (HaveOccurred ())
509515 defer os .RemoveAll (tempDir ) //nolint:errcheck
510516
511- err = bosh .Run (fmt .Sprintf ("-d %s logs %s/%d --dir %s" , deploymentName , instanceName , index , tempDir ))
517+ err = bosh .Run (fmt .Sprintf ("--deployment= %s logs %s/%d --dir %s" , deploymentName , instanceName , index , tempDir ))
512518 Expect (err ).NotTo (HaveOccurred ())
513519
514520 matches , err := filepath .Glob (filepath .Join (tempDir , fmt .Sprintf ("%s.%s.%d-*.tgz" , deploymentName , instanceName , index )))
0 commit comments