Skip to content

Commit

Permalink
Merge branch 'develop' into registry-removal
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurab Dey <[email protected]>
  • Loading branch information
h4xnoodle authored and Gaurab Dey committed Jun 8, 2018
2 parents f588153 + 23619f9 commit a5cc9a9
Show file tree
Hide file tree
Showing 331 changed files with 46,989 additions and 11,316 deletions.
81 changes: 66 additions & 15 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,19 @@ required = ["github.com/onsi/ginkgo/ginkgo"]
[[constraint]]
branch = "master"
name = "golang.org/x/sys"

[[constraint]]
branch = "master"
name = "github.com/masterzen/winrm"

[[override]]
branch = "master"
name = "github.com/masterzen/azure-sdk-for-go"

[[override]]
name = "github.com/masterzen/simplexml"
revision = "95ba30457eb1121fa27753627c774c7cd4e90083"

[[override]]
name = "github.com/ChrisTrenkamp/goxpath"
branch = "master"
4 changes: 1 addition & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ Vagrant.configure('2') do |config|
config.vm.provision :shell, inline: "mkdir -p /vagrant && chmod 777 /vagrant"
config.vm.provision :shell, inline: "chmod 777 /var/vcap/sys/log/cpi"

config.vm.provision :shell, inline: "sudo apt-get update && sudo apt-get install -y jq"
config.vm.provision :shell, inline: "sudo apt-get update && sudo apt-get install -y jq curl"
config.vm.provision :shell, inline: "sudo #{agent_dir}/integration/assets/install-go.sh"
config.vm.provision :shell, inline: "sudo cp #{agent_dir}/integration/assets/bosh-start-logging-and-auditing /var/vcap/bosh/bin/bosh-start-logging-and-auditing"
config.vm.provision :shell, inline: "sudo #{agent_dir}/integration/assets/install-agent.sh"
config.vm.provision :shell, inline: "sudo #{agent_dir}/integration/assets/install-fake-registry.sh"
config.vm.provision :shell, inline: "sudo #{agent_dir}/integration/assets/disable_growpart.sh"
end
1 change: 1 addition & 0 deletions agent/action/concrete_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewFactory(
"ssh": NewSSH(settingsService, platform, dirProvider, logger),
"fetch_logs": NewFetchLogs(compressor, copier, blobstore, dirProvider),
"update_settings": NewUpdateSettings(settingsService, platform, certManager, logger),
"shutdown": NewShutdown(platform),

// Job management
"prepare": NewPrepare(applier),
Expand Down
33 changes: 26 additions & 7 deletions agent/action/concrete_factory_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package action_test

import (
. "github.com/cloudfoundry/bosh-agent/agent/action"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

. "github.com/cloudfoundry/bosh-agent/agent/action"
"github.com/cloudfoundry/bosh-agent/agent/script/scriptfakes"
"github.com/cloudfoundry/bosh-agent/platform/platformfakes"

boshscript "github.com/cloudfoundry/bosh-agent/agent/script"
boshdir "github.com/cloudfoundry/bosh-agent/settings/directories"
Expand All @@ -13,21 +15,20 @@ import (
fakeas "github.com/cloudfoundry/bosh-agent/agent/applier/applyspec/fakes"
fakeappl "github.com/cloudfoundry/bosh-agent/agent/applier/fakes"
fakecomp "github.com/cloudfoundry/bosh-agent/agent/compiler/fakes"
fakescript "github.com/cloudfoundry/bosh-agent/agent/script/fakes"
faketask "github.com/cloudfoundry/bosh-agent/agent/task/fakes"
fakejobsuper "github.com/cloudfoundry/bosh-agent/jobsupervisor/fakes"
fakenotif "github.com/cloudfoundry/bosh-agent/notification/fakes"
fakeplatform "github.com/cloudfoundry/bosh-agent/platform/fakes"
fakesettings "github.com/cloudfoundry/bosh-agent/settings/fakes"
fakeblobstore "github.com/cloudfoundry/bosh-utils/blobstore/fakes"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
)

//go:generate counterfeiter -o fakes/fake_clock.go ../../vendor/code.cloudfoundry.org/clock Clock

var _ = Describe("concreteFactory", func() {
var (
settingsService *fakesettings.FakeSettingsService
platform *fakeplatform.FakePlatform
platform *platformfakes.FakePlatform
blobstore *fakeblobstore.FakeDigestBlobstore
blobManager *fakeblobstore.FakeBlobManagerInterface
taskService *faketask.FakeService
Expand All @@ -39,11 +40,17 @@ var _ = Describe("concreteFactory", func() {
jobScriptProvider boshscript.JobScriptProvider
factory Factory
logger boshlog.Logger
fileSystem *fakesys.FakeFileSystem
)

BeforeEach(func() {
settingsService = &fakesettings.FakeSettingsService{}
platform = fakeplatform.NewFakePlatform()

platform = &platformfakes.FakePlatform{}
fileSystem = fakesys.NewFakeFileSystem()
platform.GetFsReturns(fileSystem)
platform.GetDirProviderReturns(boshdir.NewProvider("/var/vcap"))

blobstore = &fakeblobstore.FakeDigestBlobstore{}
blobManager = &fakeblobstore.FakeBlobManagerInterface{}
taskService = &faketask.FakeService{}
Expand All @@ -52,7 +59,7 @@ var _ = Describe("concreteFactory", func() {
compiler = fakecomp.NewFakeCompiler()
jobSupervisor = fakejobsuper.NewFakeJobSupervisor()
specService = fakeas.NewFakeV1Service()
jobScriptProvider = &fakescript.FakeJobScriptProvider{}
jobScriptProvider = &scriptfakes.FakeJobScriptProvider{}
logger = boshlog.NewLogger(boshlog.LevelNone)

factory = NewFactory(
Expand Down Expand Up @@ -80,7 +87,13 @@ var _ = Describe("concreteFactory", func() {
It("apply", func() {
action, err := factory.Create("apply")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewApply(applier, specService, settingsService, boshdir.NewProvider("/var/vcap"), platform.GetFs())))
Expect(action).To(BeEquivalentTo(NewApply(
applier,
specService,
settingsService,
boshdir.NewProvider("/var/vcap"),
fileSystem,
)))
})

It("drain", func() {
Expand Down Expand Up @@ -200,6 +213,12 @@ var _ = Describe("concreteFactory", func() {
Expect(action).To(Equal(NewDeleteARPEntries(platform)))
})

It("shutdown", func() {
action, err := factory.Create("shutdown")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewShutdown(platform)))
})

It("sync_dns", func() {
action, err := factory.Create("sync_dns")
Expect(err).ToNot(HaveOccurred())
Expand Down
11 changes: 6 additions & 5 deletions agent/action/delete_arp_entries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
. "github.com/onsi/gomega"

. "github.com/cloudfoundry/bosh-agent/agent/action"
fakeplatform "github.com/cloudfoundry/bosh-agent/platform/fakes"
"github.com/cloudfoundry/bosh-agent/platform/platformfakes"
)

var _ = Describe("Delete ARP Entries", func() {
var (
platform *fakeplatform.FakePlatform
platform *platformfakes.FakePlatform
action DeleteARPEntriesAction
addresses []string
args DeleteARPEntriesActionArgs
)

BeforeEach(func() {
platform = new(fakeplatform.FakePlatform)
platform = &platformfakes.FakePlatform{}
action = NewDeleteARPEntries(platform)
addresses = []string{"10.0.0.1", "10.0.0.2"}
args = DeleteARPEntriesActionArgs{
Expand All @@ -33,10 +33,11 @@ var _ = Describe("Delete ARP Entries", func() {
AssertActionIsNotResumable(action)

It("requests deletion of all provided IPs from the ARP cache", func() {
Expect(platform.LastIPDeletedFromARP).To(Equal(""))
_, err := action.Run(args)
Expect(err).ToNot(HaveOccurred())
Expect(platform.LastIPDeletedFromARP).To(Equal("10.0.0.2"))
Expect(platform.DeleteARPEntryWithIPCallCount()).To(Equal(2))
Expect(platform.DeleteARPEntryWithIPArgsForCall(0)).To(Equal("10.0.0.1"))
Expect(platform.DeleteARPEntryWithIPArgsForCall(1)).To(Equal("10.0.0.2"))
})

It("returns an empty map", func() {
Expand Down
Loading

0 comments on commit a5cc9a9

Please sign in to comment.