Documentation ¶
Index ¶
- func PassedPercentage(p *passFailRow) float64
- func PrintJUnitResults(filename string, results []*Result, ignoreLoopback bool) error
- func PrintNetworkPolicy(p *networkingv1.NetworkPolicy) string
- func ResultsToJUnit(results []*JUnitTestResult) junit.JUnitTestSuite
- func RunTestCaseStateTests()
- type Comparison
- type ComparisonTable
- func (c *ComparisonTable) Get(from string, to string) *Item
- func (c *ComparisonTable) RenderSuccessTable() string
- func (c *ComparisonTable) ResultsByProtocol() map[bool]map[v1.Protocol]int
- func (c *ComparisonTable) Set(from string, to string, value *Item)
- func (c *ComparisonTable) ValueCounts(ignoreLoopback bool) map[Comparison]int
- func (c *ComparisonTable) ValueCountsByProtocol(ignoreLoopback bool) map[v1.Protocol]map[Comparison]int
- type Interpreter
- type InterpreterConfig
- type Item
- type JUnitTestResult
- type LabelsDiff
- type Printer
- type Result
- type StepResult
- type SummaryTable
- type TestCaseState
- func (t *TestCaseState) CreateNamespace(ns string, labels map[string]string) error
- func (t *TestCaseState) CreatePod(ns string, pod string, labels map[string]string) error
- func (t *TestCaseState) CreatePolicy(policy *networkingv1.NetworkPolicy) error
- func (t *TestCaseState) DeleteNamespace(ns string) error
- func (t *TestCaseState) DeletePod(ns string, pod string) error
- func (t *TestCaseState) DeletePolicy(ns string, name string) error
- func (t *TestCaseState) ReadPolicies(namespaces []string) error
- func (t *TestCaseState) ResetClusterState() error
- func (t *TestCaseState) SetNamespaceLabels(ns string, labels map[string]string) error
- func (t *TestCaseState) SetPodLabels(ns string, pod string, labels map[string]string) error
- func (t *TestCaseState) UpdatePolicy(policy *networkingv1.NetworkPolicy) error
- func (t *TestCaseState) VerifyClusterState() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PassedPercentage ¶ added in v0.5.1
func PassedPercentage(p *passFailRow) float64
func PrintJUnitResults ¶ added in v0.4.6
func PrintNetworkPolicy ¶ added in v0.1.0
func PrintNetworkPolicy(p *networkingv1.NetworkPolicy) string
func ResultsToJUnit ¶ added in v0.4.6
func ResultsToJUnit(results []*JUnitTestResult) junit.JUnitTestSuite
func RunTestCaseStateTests ¶ added in v0.4.2
func RunTestCaseStateTests()
Types ¶
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 { Config *InterpreterConfig // 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 JobTimeoutSeconds int FailFast bool }
func (*InterpreterConfig) PerturbationWaitDuration ¶ added in v0.4.4
func (i *InterpreterConfig) PerturbationWaitDuration() time.Duration
type JUnitTestResult ¶ added in v0.4.6
type LabelsDiff ¶ added in v0.4.2
func NewLabelsDiff ¶ added in v0.4.2
func NewLabelsDiff(actual map[string]string, expected map[string]string) *LabelsDiff
func (*LabelsDiff) AreAllExpectedLabelsPresent ¶ added in v0.4.2
func (ld *LabelsDiff) AreAllExpectedLabelsPresent() bool
func (*LabelsDiff) AreLabelsEqual ¶ added in v0.4.2
func (ld *LabelsDiff) AreLabelsEqual() bool
type Printer ¶ added in v0.1.0
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
type Result ¶ added in v0.1.0
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
func (*StepResult) Passed ¶ added in v0.5.2
func (s *StepResult) Passed(ignoreLoopback bool) bool
type SummaryTable ¶ added in v0.4.6
type SummaryTable 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 }
func NewSummaryTableFromResults ¶ added in v0.4.6
func NewSummaryTableFromResults(ignoreLoopback bool, results []*Result) *SummaryTable
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) 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 (*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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.