unit

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package unit contains logic to run the unit tests against istio configuration. It intends to replicates istio logic when it comes to matching requests and defining its destinations. Once the destinations are found for a given test case, it will try to assert with the expected results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoute added in v0.1.1

func GetRoute(input parser.Input, virtualServices []*v1alpha3.VirtualService) (*networkingv1alpha3.HTTPRoute, error)

GetRoute returns the route that matched a given input.

func Run

func Run(testfiles, configfiles []string) ([]string, []string, error)

Run is the entrypoint to run all unit tests defined in test cases

Types

type ExtendedStringMatch

type ExtendedStringMatch struct {
	*v1alpha3.StringMatch
}

ExtendedStringMatch copies istio ExtendedStringMatch definition and extends it to add helper methods.

func (ExtendedStringMatch) IsEmpty

func (sm ExtendedStringMatch) IsEmpty() bool

IsEmpty returns true if struct is empty

func (*ExtendedStringMatch) Match

func (sm *ExtendedStringMatch) Match(s string) (bool, error)

Match will return true if a given string matches a StringMatch object.

Jump to

Keyboard shortcuts

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