Skip to content

Commit

Permalink
Director pre-backup-check succeeds when lock ordering is specified
Browse files Browse the repository at this point in the history
- removed unused director lock orderer

[#163477907]

Signed-off-by: Emmanouil Kiagias <[email protected]>
  • Loading branch information
Jake Klein authored and alamages committed Feb 20, 2019
1 parent f6d65a2 commit d723a87
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 120 deletions.
4 changes: 2 additions & 2 deletions factory/director_backup_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func BuildDirectorBackupChecker(host, username, privateKeyPath, bbrVersion strin
host,
username,
privateKeyPath,
instance.NewJobFinder(bbrVersion, logger),
instance.NewJobFinderOmitMetadataReleases(bbrVersion, logger),
ssh.NewSshRemoteRunner,
)

return orchestrator.NewBackupChecker(logger, deploymentManager, orderer.NewDirectorLockOrderer())
return orchestrator.NewBackupChecker(logger, deploymentManager, orderer.NewKahnBackupLockOrderer())
}
26 changes: 5 additions & 21 deletions integration/director/pre_backup_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,35 +92,19 @@ printf "backupcontent2" > $BBR_ARTIFACT_DIRECTORY/backupdump2

Context("and there is a metadata script", func() {
BeforeEach(func() {

directorInstance.CreateScript("/var/vcap/jobs/uaa/bin/bbr/pre-backup-lock",
`#!/usr/bin/env sh
touch /tmp/uaa-pre-backup-lock-called
exit 0`)
directorInstance.CreateScript("/var/vcap/jobs/uaa/bin/bbr/metadata",
directorInstance.CreateScript("/var/vcap/jobs/bosh/bin/bbr/metadata",
`#!/usr/bin/env sh
echo "---
backup_should_be_locked_before:
restore_should_be_locked_before:
- job_name: postgres
release: bosh
"`)
})

It("fails", func() {
By("returning exit code 1", func() {
Expect(session.ExitCode()).To(Equal(1))
})

By("printing an helpful error", func() {
Expect(session.Out).To(gbytes.Say("Director cannot be backed up."))
Expect(session.Err).To(gbytes.Say(
fmt.Sprintf("director job 'uaa' specifies locking dependencies, which are not allowed for director jobs")))
})

By("not printing the stack trace to stderr", func() {
Expect(string(session.Err.Contents())).NotTo(ContainSubstring("main.go"))
})
It("succeeds", func() {
Expect(session.ExitCode()).To(Equal(0))
})

})
})

Expand Down
24 changes: 0 additions & 24 deletions orderer/director_lock_orderer.go

This file was deleted.

73 changes: 0 additions & 73 deletions orderer/director_lock_orderer_test.go

This file was deleted.

0 comments on commit d723a87

Please sign in to comment.