Documentation ¶
Index ¶
- Constants
- Variables
- func Do(address string) error
- func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{})
- func ExpectEmpty(actual interface{}, explain ...interface{})
- func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{})
- func ExpectError(err error, explain ...interface{})
- func ExpectFalse(actual interface{}, explain ...interface{})
- func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})
- func ExpectNil(actual interface{}, explain ...interface{})
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{})
- func ExpectNotNil(actual interface{}, explain ...interface{})
- func ExpectTrue(actual interface{}, explain ...interface{})
- func Failf(format string, args ...interface{})
- func KubesphereDescribe(text string, body func()) bool
- func Logf(format string, args ...interface{})
- func MakePod(ns, name string, labels, annotations map[string]string, image string, ...) *corev1.Pod
- func WaitDaemonsetPresentFitWith(client client.Client, namespace, name string, ...)
- func WaitDeploymentPresentFitWith(client client.Client, namespace, name string, ...)
- func WaitForBGPEstablished(timeout time.Duration, bgpClient *GobgpClient, num int) error
- func WaitForRouterNum(timeout time.Duration, ip string, bgpClient *GobgpClient, num int) error
- func WaitServicePresentFitWith(client client.Client, namespace, name string, ...)
- type BgpConfGlobal
- type BgpPeer
- type FailureError
- type Framework
- type GobgpClient
- func (c *GobgpClient) AddConfForGobgp(routerid string, as uint32, port int32) error
- func (c *GobgpClient) AddPeerForGobgp(address string, as uint32, port int) error
- func (c *GobgpClient) DeletePeerForGobgp(address string) error
- func (c *GobgpClient) GetAllPeers() ([]*gobgpapi.Peer, error)
- func (c *GobgpClient) GetRoutersForGobgp(ip string) (map[string]struct{}, error)
- type PodClient
- func (c *PodClient) Create(ctx context.Context, pod *corev1.Pod) *corev1.Pod
- func (c *PodClient) CreateSync(ctx context.Context, pod *corev1.Pod) *corev1.Pod
- func (c *PodClient) Delete(ctx context.Context, name string) error
- func (c *PodClient) DeleteSync(ctx context.Context, name string)
- func (c *PodClient) WaitForNotFound(ctx context.Context, name string)
- func (c *PodClient) WaitForRunning(ctx context.Context, name string)
Constants ¶
const ( PauseImage = "kubesphere/pause:3.6" // PodStartTimeout is how long to wait for the pod to be started. PodStartTimeout = 5 * time.Minute )
const (
NetworkFailure = 4
)
const (
OpenELBNamespace = "openelb-testns"
)
Variables ¶
var ErrFailure error = FailureError{}
ErrFailure is an empty error that can be wrapped to indicate that an error is a FailureError. It can also be used to test for a FailureError:.
return fmt.Errorf("some problem%w", ErrFailure) ... err := someOperation() if errors.Is(err, ErrFailure) { ... }
var Fail = ginkgo.Fail
Fail is an alias for ginkgo.Fail.
Functions ¶
func ExpectConsistOf ¶
func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{})
ExpectConsistOf expects actual contains precisely the extra elements. The ordering of the elements does not matter.
func ExpectEmpty ¶
func ExpectEmpty(actual interface{}, explain ...interface{})
ExpectEmpty expects actual is empty
func ExpectEqual ¶
func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{})
ExpectEqual expects the specified two are the same, otherwise an exception raises
func ExpectError ¶
func ExpectError(err error, explain ...interface{})
ExpectError expects an error happens, otherwise an exception raises
func ExpectFalse ¶
func ExpectFalse(actual interface{}, explain ...interface{})
ExpectFalse expects actual is false
func ExpectHaveKey ¶
func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})
ExpectHaveKey expects the actual map has the key in the keyset
func ExpectNil ¶
func ExpectNil(actual interface{}, explain ...interface{})
ExpectNil expects actual is nil
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func ExpectNotEqual ¶
func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{})
ExpectNotEqual expects the specified two are not the same, otherwise an exception raises
func ExpectNotNil ¶
func ExpectNotNil(actual interface{}, explain ...interface{})
ExpectNotNil expects actual is not nil
func ExpectTrue ¶
func ExpectTrue(actual interface{}, explain ...interface{})
ExpectTrue expects actual is true
func Failf ¶
func Failf(format string, args ...interface{})
Failf logs the fail info, including a stack trace starts with its direct caller (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "g").
func KubesphereDescribe ¶
KubesphereDescribe annotates the test with the SIG label.
func WaitDaemonsetPresentFitWith ¶
func WaitDaemonsetPresentFitWith(client client.Client, namespace, name string, fit func(DaemonSetCondition *appsv1.DaemonSet) bool)
WaitDaemonsetPresentFitWith wait daemonset present on cluster sync with fit func.
func WaitDeploymentPresentFitWith ¶
func WaitDeploymentPresentFitWith(client client.Client, namespace, name string, fit func(deployment *appsv1.Deployment) bool)
WaitDeploymentPresentFitWith wait deployment present on cluster sync with fit func.
func WaitForBGPEstablished ¶
func WaitForBGPEstablished(timeout time.Duration, bgpClient *GobgpClient, num int) error
func WaitForRouterNum ¶
Types ¶
type BgpConfGlobal ¶
type BgpPeer ¶
type FailureError ¶
type FailureError struct {
// contains filtered or unexported fields
}
FailureError is an error where the error string is meant to be passed to ginkgo.Fail directly, i.e. adding some prefix like "unexpected error" is not necessary. It is also not necessary to dump the error struct.
func (FailureError) Backtrace ¶
func (f FailureError) Backtrace() string
func (FailureError) Error ¶
func (f FailureError) Error() string
func (FailureError) Is ¶
func (f FailureError) Is(target error) bool
type Framework ¶
type Framework struct { KubeConfig string *framework.Framework Scheme *runtime.Scheme OpenELBClient client.Client }
func NewDefaultFramework ¶
func (*Framework) PodClientNS ¶
type GobgpClient ¶
type GobgpClient struct {
gobgpapi.GobgpApiClient
}
func NewGobgpClient ¶
func (*GobgpClient) AddConfForGobgp ¶
func (c *GobgpClient) AddConfForGobgp(routerid string, as uint32, port int32) error
func (*GobgpClient) AddPeerForGobgp ¶
func (c *GobgpClient) AddPeerForGobgp(address string, as uint32, port int) error
func (*GobgpClient) DeletePeerForGobgp ¶
func (c *GobgpClient) DeletePeerForGobgp(address string) error
func (*GobgpClient) GetAllPeers ¶
func (c *GobgpClient) GetAllPeers() ([]*gobgpapi.Peer, error)
func (*GobgpClient) GetRoutersForGobgp ¶
func (c *GobgpClient) GetRoutersForGobgp(ip string) (map[string]struct{}, error)