当前位置: 首页>>代码示例>>Golang>>正文


Golang fake_process_tracker.FakeProcessTracker类代码示例

本文整理汇总了Golang中github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker.FakeProcessTracker的典型用法代码示例。如果您正苦于以下问题:Golang FakeProcessTracker类的具体用法?Golang FakeProcessTracker怎么用?Golang FakeProcessTracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FakeProcessTracker类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

	"github.com/cloudfoundry-incubator/garden-linux/port_pool/fake_port_pool"
	"github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker"
	wfakes "github.com/cloudfoundry-incubator/garden/fakes"
	"github.com/cloudfoundry/gunk/command_runner/fake_command_runner"
	. "github.com/cloudfoundry/gunk/command_runner/fake_command_runner/matchers"
)

var _ = Describe("Linux containers", func() {
	var fakeCgroups *fake_cgroups_manager.FakeCgroupsManager
	var fakeQuotaManager *fake_quota_manager.FakeQuotaManager
	var fakeBandwidthManager *fake_bandwidth_manager.FakeBandwidthManager
	var fakeRunner *fake_command_runner.FakeCommandRunner
	var containerResources *linux_backend.Resources
	var container *linux_container.LinuxContainer
	var fakePortPool *fake_port_pool.FakePortPool
	var fakeProcessTracker *fake_process_tracker.FakeProcessTracker
	var fakeFilter *networkFakes.FakeFilter
	var fakeOomWatcher *fake_watcher.FakeWatcher
	var containerDir string
	var containerProps map[string]string

	BeforeEach(func() {
		fakeRunner = fake_command_runner.New()

		fakeCgroups = fake_cgroups_manager.New("/cgroups", "some-id")

		fakeQuotaManager = new(fake_quota_manager.FakeQuotaManager)
		fakeBandwidthManager = fake_bandwidth_manager.New()
		fakeProcessTracker = new(fake_process_tracker.FakeProcessTracker)
		fakeFilter = new(networkFakes.FakeFilter)
		fakeOomWatcher = new(fake_watcher.FakeWatcher)
开发者ID:guanglinlv,项目名称:garden-linux,代码行数:31,代码来源:linux_container_test.go

示例2:

	"github.com/cloudfoundry-incubator/garden-linux/linux_container/cgroups_manager/fake_cgroups_manager"
	"github.com/cloudfoundry-incubator/garden-linux/linux_container/fake_network_statisticser"
	"github.com/cloudfoundry-incubator/garden-linux/linux_container/fake_quota_manager"
	"github.com/cloudfoundry-incubator/garden-linux/linux_container/fake_watcher"
	networkFakes "github.com/cloudfoundry-incubator/garden-linux/network/fakes"
	"github.com/cloudfoundry-incubator/garden-linux/port_pool/fake_port_pool"
	"github.com/cloudfoundry-incubator/garden-linux/process_tracker"
	"github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker"
	wfakes "github.com/cloudfoundry-incubator/garden/fakes"
	"github.com/cloudfoundry/gunk/command_runner/fake_command_runner"
)

var _ = Describe("Linux containers", func() {
	var containerResources *linux_backend.Resources
	var container *linux_container.LinuxContainer
	var fakeProcessTracker *fake_process_tracker.FakeProcessTracker
	var logger *lagertest.TestLogger
	var containerDir string
	var containerVersion semver.Version

	BeforeEach(func() {
		fakeProcessTracker = new(fake_process_tracker.FakeProcessTracker)
		containerVersion = semver.Version{Major: 1, Minor: 0, Patch: 0}

		var err error
		containerDir, err = ioutil.TempDir("", "depot")
		Expect(err).ToNot(HaveOccurred())

		_, subnet, _ := net.ParseCIDR("2.3.4.0/30")
		containerResources = linux_backend.NewResources(
			1235,
开发者ID:guanglinlv,项目名称:garden-linux,代码行数:31,代码来源:running_test.go

示例3:

import (
	"os/exec"

	"github.com/cloudfoundry-incubator/garden"
	"github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker"
	"github.com/julz/garden-runc"
	"github.com/julz/garden-runc/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("RunHandler", func() {
	var fakeContainerCmder *fakes.FakeContainerCmder
	var fakeProcessTracker *fake_process_tracker.FakeProcessTracker
	var container *gardenrunc.RunHandler

	BeforeEach(func() {
		fakeContainerCmder = new(fakes.FakeContainerCmder)
		fakeProcessTracker = new(fake_process_tracker.FakeProcessTracker)

		container = &gardenrunc.RunHandler{
			ContainerCmd:   fakeContainerCmder,
			ProcessTracker: fakeProcessTracker,
		}
	})

	Describe("Run", func() {
		It("spawns the requested program using iodaemon", func() {
			fakeContainerCmder.CmdStub = func(path string, args ...string) *exec.Cmd {
开发者ID:julz,项目名称:garden-runc,代码行数:30,代码来源:run_test.go

示例4:

	"github.com/cloudfoundry-incubator/garden-linux/process_tracker"
	"github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker"
	wfakes "github.com/cloudfoundry-incubator/garden/fakes"
	"github.com/cloudfoundry/gunk/command_runner/fake_command_runner"
	. "github.com/cloudfoundry/gunk/command_runner/fake_command_runner/matchers"
)

var _ = Describe("Linux containers", func() {
	var (
		fakeCgroups          *fake_cgroups_manager.FakeCgroupsManager
		fakeQuotaManager     *fake_quota_manager.FakeQuotaManager
		fakeBandwidthManager *fake_bandwidth_manager.FakeBandwidthManager
		fakeRunner           *fake_command_runner.FakeCommandRunner
		containerResources   *linux_backend.Resources
		container            *linux_container.LinuxContainer
		fakePortPool         *fake_port_pool.FakePortPool
		fakeProcessTracker   *fake_process_tracker.FakeProcessTracker
		fakeFilter           *networkFakes.FakeFilter
		fakeOomWatcher       *fake_watcher.FakeWatcher
		containerDir         string
		containerProps       map[string]string
		containerVersion     semver.Version
		fakeIPTablesManager  *fake_iptables_manager.FakeIPTablesManager
	)

	netOutRule1 := garden.NetOutRule{
		Protocol: garden.ProtocolUDP,
		Networks: []garden.IPRange{garden.IPRangeFromIP(net.ParseIP("1.2.3.4"))},
		Ports:    []garden.PortRange{{Start: 12, End: 24}},
		ICMPs:    &garden.ICMPControl{Type: 3, Code: garden.ICMPControlCode(12)},
		Log:      true,
	}
开发者ID:nagyistoce,项目名称:garden-linux,代码行数:32,代码来源:snapshotting_test.go


注:本文中的github.com/cloudfoundry-incubator/garden-linux/process_tracker/fake_process_tracker.FakeProcessTracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。