testutils

package
v1.0.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var EgressRule1 = api.Rule{
	Action:    "pass",
	IPVersion: &ipv4,
	Protocol:  &numProtocol1,
	ICMP:      &icmp1,
	Source: api.EntityRule{
		Tag:      "tag3",
		Net:      &cidr2,
		Selector: "selector3",
	},
}
View Source
var EgressRule2 = api.Rule{
	Action:    "allow",
	IPVersion: &ipv6,
	Protocol:  &strProtocol2,
	ICMP:      &icmp1,
	Source: api.EntityRule{
		Tag:      "tag4",
		Net:      &cidrv62,
		Selector: "selector4",
	},
}
View Source
var InRule1 = api.Rule{
	Action:    "allow",
	IPVersion: &ipv4,
	Protocol:  &strProtocol1,
	ICMP:      &icmp1,
	Source: api.EntityRule{
		Tag:      "tag1",
		Net:      &cidr1,
		Selector: "selector1",
	},
}
View Source
var InRule2 = api.Rule{
	Action:    "deny",
	IPVersion: &ipv6,
	Protocol:  &numProtocol1,
	ICMP:      &icmp1,
	Source: api.EntityRule{
		Tag:      "tag2",
		Net:      &cidrv61,
		Selector: "selector2",
	},
}

Functions

func CleanEtcd

func CleanEtcd()

CleanEtcd is a utility function to wipe clean "/calico" recursively from etcd.

func CreateNewIPPool

func CreateNewIPPool(c client.Client, poolSubnet string, ipip, natOut, ipam bool)

CreateNewIPPool takes a client.Client with a poolSubnet CIDR (in "192.168.1.0/24" format) with ipip, natOut, and ipam bools for the pool to be setup and creates a new pool.

func CreateRule

func CreateRule(ipv, icmpType, icmpCode int, proto, cidrStr, tag, selector, inAction, eAction string) (api.Rule, api.Rule)

CreateRule takes all fields necessary to create a api.Rule object and returns ingress and egress api.Rules.

func DumpEtcd

func DumpEtcd()

DumpEtcd prints out a recursive dump of the contents of etcd.

func HookLogrusForGinkgo

func HookLogrusForGinkgo()

func MustParseCIDR

func MustParseCIDR(c string) net.IPNet

func MustParseIP

func MustParseIP(i string) net.IP

func NewClient

func NewClient(cf string) (*client.Client, error)

NewClient is a util function to create a new default client. When passed empty string, it loads the default config instead from a config file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL