Documentation
¶
Index ¶
- Constants
- Variables
- func BeEquivalentToError(expected error) types.GomegaMatcher
- func CleanupNodePoolLabel(ctx context.Context, k8sClient client.Client) error
- func DeleteNodePool(ctx context.Context, k8sClient client.Client, name 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 ExpectHaveKey(actual interface{}, key 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 GetNodepool(ctx context.Context, k8sClient client.Client, name string) (*v1beta2.NodePool, error)
- func InitTestNodePool(ctx context.Context, k8sClient client.Client, pool TestNodePool) error
- func JSONMarshal(o interface{}) []byte
- func LoadRESTClientConfigFromEnv(kubeconfig string) (*restclient.Config, error)
- func LoadRestConfigAndClientset(kubeconfig string) (*restclient.Config, *clientset.Clientset, error)
- func PrepareNodePoolWithNode(ctx context.Context, k8sClient client.Client, nodeName string) error
- func SetYurtE2eCfg() error
- func WaitForNamespacesDeleted(c clientset.Interface, namespaces []string, timeout time.Duration) error
- type AlreadyExistMatcher
- type ErrorMatcher
- type NotFoundMatcher
- type TestNodePool
Constants ¶
const ( // DefaultNamespaceDeletionTimeout is timeout duration for waiting for a namespace deletion. DefaultNamespaceDeletionTimeout = 5 * time.Minute // PodStartTimeout is how long to wait for the pod to be started. PodStartTimeout = 5 * time.Minute )
const (
NodePoolName = "yurt-pool2"
)
Variables ¶
var AccessKeyID = flag.String("access-key-id", "", "aliyun AccessKeyId for ailunyun:ecs/ens")
var AccessKeySecret = flag.String("access-key-secret", "", "aliyun AccessKeySecret for ailunyun:ecs/ens")
var EnableYurtAutonomy = flag.Bool( "enable-yurt-autonomy", false, "switch of yurt node autonomy. If set to true, yurt node autonomy test can be run normally", )
var Kubeconfig = flag.String("kubeconfig", "", "kubeconfig file path for OpenYurt cluster")
var NodeType = flag.String("node-type", "minikube", "node type such as ailunyun:ecs/ens, minikube and user_self")
var RegionID = flag.String("region-id", "", "aliyun region id for ailunyun:ecs/ens")
var ReportDir = flag.String(
"report-dir",
"",
"Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.",
)
Functions ¶
func BeEquivalentToError ¶ added in v1.3.0
func BeEquivalentToError(expected error) types.GomegaMatcher
BeEquivalentToError matches the error to take care of nil.
func CleanupNodePoolLabel ¶ added in v1.3.0
func DeleteNodePool ¶ added in v1.7.0
DeleteNodePool will delete the nodepool with the given name
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 ExpectHaveKey ¶
func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})
ExpectHaveKey expects the actual map has the key in the keyset
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 GetNodepool ¶ added in v1.7.0
func GetNodepool(ctx context.Context, k8sClient client.Client, name string) (*v1beta2.NodePool, error)
GetNodepool will get the nodepool with the given name
func InitTestNodePool ¶ added in v1.7.0
InitTestNodePool will create nodepools and add labels to nodes according to the pools
func JSONMarshal ¶ added in v1.3.0
func JSONMarshal(o interface{}) []byte
JSONMarshal returns the JSON encoding
func LoadRESTClientConfigFromEnv ¶ added in v1.1.0
func LoadRESTClientConfigFromEnv(kubeconfig string) (*restclient.Config, error)
Load restClientConfig from env
func LoadRestConfigAndClientset ¶
func LoadRestConfigAndClientset(kubeconfig string) (*restclient.Config, *clientset.Clientset, error)
LoadRestConfigAndClientset returns rest config and clientset for connecting to kubernetes clusters.
func PrepareNodePoolWithNode ¶ added in v1.5.0
PrepareNodePoolWithNode will create a edge nodepool named "nodepool-with-node" and add the "openyurt-e2e-test-worker" node to this nodepool. In order for Pods to be successfully deployed in e2e tests, a nodepool with nodes needs to be created
Types ¶
type AlreadyExistMatcher ¶ added in v1.3.0
type AlreadyExistMatcher struct {
}
AlreadyExistMatcher matches the error to be already exist
func (AlreadyExistMatcher) FailureMessage ¶ added in v1.3.0
func (matcher AlreadyExistMatcher) FailureMessage(actual interface{}) (message string)
FailureMessage builds an error message.
func (AlreadyExistMatcher) Match ¶ added in v1.3.0
func (matcher AlreadyExistMatcher) Match(actual interface{}) (success bool, err error)
Match matches error.
func (AlreadyExistMatcher) NegatedFailureMessage ¶ added in v1.3.0
func (matcher AlreadyExistMatcher) NegatedFailureMessage(actual interface{}) (message string)
NegatedFailureMessage builds an error message.
type ErrorMatcher ¶ added in v1.3.0
type ErrorMatcher struct {
ExpectedError error
}
ErrorMatcher matches errors.
func (ErrorMatcher) FailureMessage ¶ added in v1.3.0
func (matcher ErrorMatcher) FailureMessage(actual interface{}) (message string)
FailureMessage builds an error message.
func (ErrorMatcher) Match ¶ added in v1.3.0
func (matcher ErrorMatcher) Match(actual interface{}) (success bool, err error)
Match matches an error.
func (ErrorMatcher) NegatedFailureMessage ¶ added in v1.3.0
func (matcher ErrorMatcher) NegatedFailureMessage(actual interface{}) (message string)
NegatedFailureMessage builds an error message.
type NotFoundMatcher ¶ added in v1.3.0
type NotFoundMatcher struct {
}
NotFoundMatcher matches the error to be not found.
func (NotFoundMatcher) FailureMessage ¶ added in v1.3.0
func (matcher NotFoundMatcher) FailureMessage(actual interface{}) (message string)
FailureMessage builds an error message.
func (NotFoundMatcher) Match ¶ added in v1.3.0
func (matcher NotFoundMatcher) Match(actual interface{}) (success bool, err error)
Match matches the api error.
func (NotFoundMatcher) NegatedFailureMessage ¶ added in v1.3.0
func (matcher NotFoundMatcher) NegatedFailureMessage(actual interface{}) (message string)
NegatedFailureMessage builds an error message.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string. |