framework

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodImage     = "nicolaka/netshoot"
	E2ENamespace = "default"
)

Variables

This section is empty.

Functions

func GenerateTestCases

func GenerateTestCases(f *Framework, testcases []*TestSpec)

Types

type Assertion

type Assertion struct {
	Succeed     bool
	Nodes       []string
	NoSuspicion bool
	Suspicions  []AssertionSuspicion
	Actions     []AssertionAction
}

type AssertionAction

type AssertionAction struct {
	On   string
	Type model.ActionType
}
type AssertionLink struct {
	From   string
	To     string
	Oif    string
	Iif    string
	Packet *AssertionPacket
}

type AssertionPacket

type AssertionPacket struct {
}

type AssertionSuspicion

type AssertionSuspicion struct {
	On       string
	Level    model.SuspicionLevel
	Contains string
}

type DiagnoseArgs

type DiagnoseArgs struct {
	Src            string
	Dst            string
	Port           uint16
	Protocol       string
	CloudProvider  string
	KubeConfig     string
	CollectorImage string
	ExtraArgs      []string
}

type DiagnoseResult

type DiagnoseResult struct {
	Succeed bool
	Error   string
	Summary *ui.DiagnoseSummary
}

type DiagnoseSpec

type DiagnoseSpec struct {
	From     string
	To       string
	Port     uint16
	Protocol model.Protocol
}

func NewDiagnoseSpec

func NewDiagnoseSpec(from, to string, port uint16, protocol model.Protocol) DiagnoseSpec

type Framework

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

func NewFramework

func NewFramework(c *kubernetes.Clientset, rest *rest.Config, skoopPath string,
	cloudProvider, kubeConfig, collectorImage string, extraDiagnoseArgs []string) (*Framework, error)

func (*Framework) Assert

func (f *Framework) Assert() error

func (*Framework) AssignNodes

func (f *Framework) AssignNodes() error

func (*Framework) Client

func (f *Framework) Client() *kubernetes.Clientset

func (*Framework) Node

func (f *Framework) Node(id string) *v1.Node

func (*Framework) Pod

func (f *Framework) Pod(id string) *v1.Pod

func (*Framework) Prepare

func (f *Framework) Prepare() error

func (*Framework) Recover

func (f *Framework) Recover() error

func (*Framework) RestConfig

func (f *Framework) RestConfig() *rest.Config

func (*Framework) RunDiagnose

func (f *Framework) RunDiagnose() error

func (*Framework) Service

func (f *Framework) Service(id string) *v1.Service

func (*Framework) SetTestSpec

func (f *Framework) SetTestSpec(spec *TestSpec)

type NetworkPolicySpec

type NetworkPolicySpec struct {
}

type NodeSpec

type NodeSpec struct {
	ID              string
	Commands        []string
	RecoverCommands []string // todo: recreate node
	PodSpecs        []*PodSpec
	Listen          uint16
	ListenProtocol  model.Protocol
	ExtraInfo       map[string]string
	// contains filtered or unexported fields
}

type PodSpec

type PodSpec struct {
	ID             string
	Commands       []string
	Listen         uint16
	ListenProtocol model.Protocol
	Annotations    map[string]string
	ExtraInfo      map[string]string
	// contains filtered or unexported fields
}

type ServiceSpec

type ServiceSpec struct {
	ID             string
	Endpoints      []string
	Port           uint16
	TargetPort     uint16
	TargetPortName string
	Protocol       model.Protocol
	// contains filtered or unexported fields
}

type TestSpec

type TestSpec struct {
	Name              string
	NodeSpecs         []*NodeSpec
	ServiceSpecs      []*ServiceSpec
	NetworkPolicySpec []*NetworkPolicySpec
	DiagnoseSpec      DiagnoseSpec
	//TODO: provider spec & k8s spec (network policy, service)
	Assertion    Assertion
	ProviderSpec interface{}
	ExtraSpec    interface{}
}

Jump to

Keyboard shortcuts

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