Skip to content

Commit

Permalink
Chowning no longer breaks integration tests
Browse files Browse the repository at this point in the history
- if we try to really chown to group vcap when no such group exists, it
would be broken in CI
- now, we don't do that when running tests

[#154423151](https://www.pivotaltracker.com/story/show/154423151)

Signed-off-by: Joshua Aresty <joshua.aresty@emc.com>
  • Loading branch information
J Evelyn Quintana authored and Joshua Aresty committed Jan 27, 2018
1 parent 026134b commit 7b2887c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/agent.go
Expand Up @@ -9,6 +9,7 @@ import (

boshapp "github.com/cloudfoundry/bosh-agent/app"
"github.com/cloudfoundry/bosh-agent/infrastructure/agentlogger"
"github.com/cloudfoundry/bosh-agent/platform"
"github.com/cloudfoundry/bosh-utils/logger"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
boshsys "github.com/cloudfoundry/bosh-utils/system"
Expand All @@ -25,6 +26,10 @@ func runAgent(opts boshapp.Options, logger logger.Logger) chan error {
logger.Debug(mainLogTag, "Starting agent")

fs := boshsys.NewOsFileSystem(logger)
if opts.PlatformName == "dummy" {
fs = platform.DummyWrapFs(fs)
}

app := boshapp.New(logger, fs)

err := app.Setup(opts)
Expand Down
19 changes: 19 additions & 0 deletions platform/dummy_wrap_fs.go
@@ -0,0 +1,19 @@
package platform

import boshsys "github.com/cloudfoundry/bosh-utils/system"

var _ boshsys.FileSystem = &DummyFs{}

func DummyWrapFs(fs boshsys.FileSystem) boshsys.FileSystem {
return &DummyFs{
FileSystem: fs,
}
}

type DummyFs struct {
boshsys.FileSystem
}

func (d *DummyFs) Chown(path string, username string) error {
return nil
}

0 comments on commit 7b2887c

Please sign in to comment.