"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)
Exemplo n.º 2
0
	"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,
	}