本文整理匯總了Golang中github.com/cloudfoundry/bosh-utils/system/fakes.FakeFileSystem.EnableStrictTempRootBehavior方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeFileSystem.EnableStrictTempRootBehavior方法的具體用法?Golang FakeFileSystem.EnableStrictTempRootBehavior怎麽用?Golang FakeFileSystem.EnableStrictTempRootBehavior使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/bosh-utils/system/fakes.FakeFileSystem
的用法示例。
在下文中一共展示了FakeFileSystem.EnableStrictTempRootBehavior方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: rootDesc
func rootDesc() {
var mockCtrl *gomock.Controller
BeforeEach(func() {
mockCtrl = gomock.NewController(GinkgoT())
})
AfterEach(func() {
mockCtrl.Finish()
})
Describe("Run", func() {
var (
command bicmd.Cmd
fakeFs *fakesys.FakeFileSystem
stdOut *gbytes.Buffer
stdErr *gbytes.Buffer
userInterface biui.UI
sha1Calculator crypto.SHA1Calculator
manifestSHA1 string
mockDeployer *mock_deployment.MockDeployer
mockInstaller *mock_install.MockInstaller
mockInstallerFactory *mock_install.MockInstallerFactory
mockReleaseExtractor *mock_release.MockExtractor
releaseManager birel.Manager
mockRegistryServerManager *mock_registry.MockServerManager
mockRegistryServer *mock_registry.MockServer
mockAgentClient *mock_agentclient.MockAgentClient
mockAgentClientFactory *mock_httpagent.MockAgentClientFactory
mockCloudFactory *mock_cloud.MockFactory
fakeCPIRelease *fakebirel.FakeRelease
logger boshlog.Logger
mockBlobstoreFactory *mock_blobstore.MockFactory
mockBlobstore *mock_blobstore.MockBlobstore
mockVMManagerFactory *mock_vm.MockManagerFactory
fakeVMManager *fakebivm.FakeManager
fakeStemcellExtractor *fakebistemcell.FakeExtractor
mockStemcellManager *mock_stemcell.MockManager
fakeStemcellManagerFactory *fakebistemcell.FakeManagerFactory
fakeReleaseSetParser *fakebirelsetmanifest.FakeParser
fakeInstallationParser *fakebiinstallmanifest.FakeParser
fakeDeploymentParser *fakebideplmanifest.FakeParser
mockLegacyDeploymentStateMigrator *mock_config.MockLegacyDeploymentStateMigrator
setupDeploymentStateService biconfig.DeploymentStateService
fakeDeploymentValidator *fakebideplval.FakeValidator
directorID = "generated-director-uuid"
fakeUUIDGenerator *fakeuuid.FakeGenerator
configUUIDGenerator *fakeuuid.FakeGenerator
fakeStage *fakebiui.FakeStage
deploymentManifestPath string
deploymentStatePath string
cpiReleaseTarballPath string
stemcellTarballPath string
extractedStemcell bistemcell.ExtractedStemcell
expectDeploy *gomock.Call
mbusURL = "http://fake-mbus-user:[email protected]"
releaseSetManifest birelsetmanifest.Manifest
boshDeploymentManifest bideplmanifest.Manifest
installationManifest biinstallmanifest.Manifest
cloud bicloud.Cloud
cloudStemcell bistemcell.CloudStemcell
expectLegacyMigrate *gomock.Call
expectStemcellUpload *gomock.Call
expectStemcellDeleteUnused *gomock.Call
expectCPIReleaseExtract *gomock.Call
expectInstall *gomock.Call
expectNewCloud *gomock.Call
)
BeforeEach(func() {
logger = boshlog.NewLogger(boshlog.LevelNone)
stdOut = gbytes.NewBuffer()
stdErr = gbytes.NewBuffer()
userInterface = biui.NewWriterUI(stdOut, stdErr, logger)
fakeFs = fakesys.NewFakeFileSystem()
fakeFs.EnableStrictTempRootBehavior()
deploymentManifestPath = "/path/to/manifest.yml"
deploymentStatePath = "/path/to/manifest-state.json"
fakeFs.RegisterOpenFile(deploymentManifestPath, &fakesys.FakeFile{
Stats: &fakesys.FakeFileStats{FileType: fakesys.FakeFileTypeFile},
})
fakeFs.WriteFileString(deploymentManifestPath, "")
mockDeployer = mock_deployment.NewMockDeployer(mockCtrl)
mockInstaller = mock_install.NewMockInstaller(mockCtrl)
mockInstallerFactory = mock_install.NewMockInstallerFactory(mockCtrl)
//.........這裏部分代碼省略.........
示例2:
),
mockAgentClient.EXPECT().Apply(applySpec),
mockAgentClient.EXPECT().RunScript("pre-start", map[string]interface{}{}),
mockAgentClient.EXPECT().Start(),
mockAgentClient.EXPECT().GetState().Return(agentRunningState, nil),
mockAgentClient.EXPECT().RunScript("post-start", map[string]interface{}{}),
)
}
BeforeEach(func() {
sshConfig = NewSSHConfig(originalHome)
err := sshConfig.Prepare()
Expect(err).ToNot(HaveOccurred())
fs = fakesys.NewFakeFileSystem()
fs.EnableStrictTempRootBehavior()
logger = boshlog.NewLogger(boshlog.LevelNone)
fakeUUIDGenerator = fakeuuid.NewFakeGenerator()
setupDeploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, biconfig.DeploymentStatePath(deploymentManifestPath))
deploymentState, err := setupDeploymentStateService.Load()
Expect(err).ToNot(HaveOccurred())
directorID = deploymentState.DirectorID
fakeAgentIDGenerator = fakeuuid.NewFakeGenerator()
fakeSHA1Calculator = fakebicrypto.NewFakeSha1Calculator()
mockInstaller = mock_install.NewMockInstaller(mockCtrl)
mockInstallerFactory = mock_install.NewMockInstallerFactory(mockCtrl)
mockCloudFactory = mock_cloud.NewMockFactory(mockCtrl)