connectivity

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintNetworkPolicy added in v0.1.0

func PrintNetworkPolicy(p *networkingv1.NetworkPolicy) string

Types

type CombinedResults added in v0.3.0

type CombinedResults struct {
	Results []*Result
}

func (*CombinedResults) Summary added in v0.3.0

func (c *CombinedResults) Summary(ignoreLoopback bool) *Summary

type Comparison added in v0.2.0

type Comparison string
const (
	SameComparison      Comparison = "same"
	DifferentComparison Comparison = "different"
	IgnoredComparison   Comparison = "ignored"
)

func (Comparison) ShortString added in v0.2.0

func (c Comparison) ShortString() string

type ComparisonTable added in v0.2.0

type ComparisonTable struct {
	Wrapped *probe.TruthTable
}

func NewComparisonTable added in v0.2.0

func NewComparisonTable(items []string) *ComparisonTable

func NewComparisonTableFrom added in v0.2.0

func NewComparisonTableFrom(kubeProbe *probe.Table, simulatedProbe *probe.Table) *ComparisonTable

func (*ComparisonTable) Get added in v0.2.0

func (c *ComparisonTable) Get(from string, to string) *Item

func (*ComparisonTable) RenderSuccessTable added in v0.2.4

func (c *ComparisonTable) RenderSuccessTable() string

func (*ComparisonTable) ResultsByProtocol added in v0.2.4

func (c *ComparisonTable) ResultsByProtocol() map[bool]map[v1.Protocol]int

func (*ComparisonTable) Set added in v0.2.0

func (c *ComparisonTable) Set(from string, to string, value *Item)

func (*ComparisonTable) ValueCounts added in v0.2.0

func (c *ComparisonTable) ValueCounts(ignoreLoopback bool) map[Comparison]int

func (*ComparisonTable) ValueCountsByProtocol added in v0.2.4

func (c *ComparisonTable) ValueCountsByProtocol(ignoreLoopback bool) map[v1.Protocol]map[Comparison]int

type Interpreter added in v0.1.0

type Interpreter struct {
	// contains filtered or unexported fields
}

func NewInterpreter added in v0.1.0

func NewInterpreter(kubernetes kube.IKubernetes, resources *probe.Resources, config *InterpreterConfig) *Interpreter

func (*Interpreter) ExecuteTestCase added in v0.1.0

func (t *Interpreter) ExecuteTestCase(testCase *generator.TestCase) *Result

type InterpreterConfig added in v0.3.1

type InterpreterConfig struct {
	ResetClusterBeforeTestCase       bool
	KubeProbeRetries                 int
	PerturbationWaitSeconds          int
	VerifyClusterStateBeforeTestCase bool
	BatchJobs                        bool
	IgnoreLoopback                   bool
}

type Item added in v0.2.4

type Item struct {
	Kube      *probe.Item
	Simulated *probe.Item
}

func (*Item) IsSuccess added in v0.2.4

func (i *Item) IsSuccess() bool

func (*Item) ResultsByProtocol added in v0.2.4

func (i *Item) ResultsByProtocol() map[bool]map[v1.Protocol]int

type Printer added in v0.1.0

type Printer struct {
	Noisy          bool
	IgnoreLoopback bool
	Results        []*Result
}

func (*Printer) PrintStep added in v0.1.0

func (t *Printer) PrintStep(i int, step *generator.TestStep, stepResult *StepResult)

func (*Printer) PrintSummary added in v0.1.0

func (t *Printer) PrintSummary()

func (*Printer) PrintTestCaseResult added in v0.1.0

func (t *Printer) PrintTestCaseResult(result *Result)

type Result added in v0.1.0

type Result struct {
	// TODO should resources be captured per-step for tests that modify them?
	InitialResources *probe.Resources
	TestCase         *generator.TestCase
	Steps            []*StepResult
	Err              error
}

func (*Result) Features added in v0.2.4

func (r *Result) Features() map[string][]string

func (*Result) ResultsByProtocol added in v0.2.4

func (r *Result) ResultsByProtocol() map[bool]map[v1.Protocol]int

type StepResult added in v0.1.0

type StepResult struct {
	SimulatedProbe *probe.Table
	KubeProbes     []*probe.Table
	Policy         *matcher.Policy
	KubePolicies   []*networkingv1.NetworkPolicy
	// contains filtered or unexported fields
}

func NewStepResult added in v0.2.4

func NewStepResult(simulated *probe.Table, policy *matcher.Policy, kubePolicies []*networkingv1.NetworkPolicy) *StepResult

func (*StepResult) AddKubeProbe added in v0.2.4

func (s *StepResult) AddKubeProbe(kubeProbe *probe.Table)

func (*StepResult) Comparison added in v0.2.4

func (s *StepResult) Comparison(i int) *ComparisonTable

func (*StepResult) LastComparison added in v0.2.4

func (s *StepResult) LastComparison() *ComparisonTable

func (*StepResult) LastKubeProbe added in v0.2.0

func (s *StepResult) LastKubeProbe() *probe.Table

type Summary added in v0.3.0

type Summary struct {
	Tests                [][]string
	Passed               int
	Failed               int
	ProtocolCounts       map[v1.Protocol]map[Comparison]int
	TagCounts            map[string]map[string]map[bool]int
	TagPrimaryCounts     map[string]map[bool]int
	FeatureCounts        map[string]map[string]map[bool]int
	FeaturePrimaryCounts map[string]map[bool]int
}

type TestCaseState added in v0.1.0

type TestCaseState struct {
	Kubernetes kube.IKubernetes
	Resources  *probe.Resources
	Policies   []*networkingv1.NetworkPolicy
}

func (*TestCaseState) CreateNamespace added in v0.2.4

func (t *TestCaseState) CreateNamespace(ns string, labels map[string]string) error

func (*TestCaseState) CreatePod added in v0.2.4

func (t *TestCaseState) CreatePod(ns string, pod string, labels map[string]string) error

func (*TestCaseState) CreatePolicy added in v0.1.0

func (t *TestCaseState) CreatePolicy(policy *networkingv1.NetworkPolicy) error

func (*TestCaseState) DeleteNamespace added in v0.2.4

func (t *TestCaseState) DeleteNamespace(ns string) error

func (*TestCaseState) DeletePod added in v0.2.4

func (t *TestCaseState) DeletePod(ns string, pod string) error

func (*TestCaseState) DeletePolicy added in v0.1.0

func (t *TestCaseState) DeletePolicy(ns string, name string) error

func (*TestCaseState) ReadPolicies added in v0.1.0

func (t *TestCaseState) ReadPolicies(namespaces []string) error

func (*TestCaseState) ResetClusterState added in v0.3.0

func (t *TestCaseState) ResetClusterState() error

func (*TestCaseState) SetNamespaceLabels added in v0.1.0

func (t *TestCaseState) SetNamespaceLabels(ns string, labels map[string]string) error

func (*TestCaseState) SetPodLabels added in v0.1.0

func (t *TestCaseState) SetPodLabels(ns string, pod string, labels map[string]string) error

func (*TestCaseState) UpdatePolicy added in v0.1.0

func (t *TestCaseState) UpdatePolicy(policy *networkingv1.NetworkPolicy) error

func (*TestCaseState) VerifyClusterState added in v0.3.0

func (t *TestCaseState) VerifyClusterState() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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