Documentation
¶
Index ¶
- Constants
- func CreateIsolatedNamespace(baseName string) string
- func CreateTestE2NodeSet(name, namespace string, replicas int32) *nephoranv1.E2NodeSet
- func CreateTestNamespace(ctx context.Context, k8sClient client.Client, namespaceName string) error
- func CreateTestNetworkIntent(name, namespace string) *nephoranv1.NetworkIntent
- func DeleteTestNamespace(ctx context.Context, k8sClient client.Client, namespaceName string) error
- func EnsureResourceDeleted(ctx context.Context, k8sClient client.Client, obj client.Object) error
- func EnsureResourceExists(ctx context.Context, k8sClient client.Client, obj client.Object) error
- func GetCondition(conditions []metav1.Condition, conditionType string) *metav1.Condition
- func GetConditionByType(conditions []metav1.Condition, conditionType string) *metav1.Condition
- func GetConditionStatus(conditions []metav1.Condition, conditionType string) metav1.ConditionStatus
- func GetRetryCount(ni *nephoranv1.NetworkIntent, operation string) int
- func HasCondition(conditions []metav1.Condition, conditionType string) bool
- func IsConditionFalse(conditions []metav1.Condition, conditionType string) bool
- func IsConditionTrue(conditions []metav1.Condition, conditionType string) bool
- func IsConditionUnknown(conditions []metav1.Condition, conditionType string) bool
- func WaitForCondition(ctx context.Context, k8sClient client.Client, obj client.Object, ...) error
- type FakeE2Manager
- func (f *FakeE2Manager) AddNode(nodeID string, node *e2.E2Node)
- func (f *FakeE2Manager) DeregisterE2Node(ctx context.Context, nodeID string) error
- func (f *FakeE2Manager) GetConnectionCallCount() int
- func (f *FakeE2Manager) GetConnections() map[string]string
- func (f *FakeE2Manager) GetDeregistrationCallCount() int
- func (f *FakeE2Manager) GetLastProvisionedSpec() nephoranv1.E2NodeSetSpec
- func (f *FakeE2Manager) GetListCallCount() int
- func (f *FakeE2Manager) GetMetrics() *e2.E2Metrics
- func (f *FakeE2Manager) GetNodes() map[string]*e2.E2Node
- func (f *FakeE2Manager) GetProvisionCallCount() int
- func (f *FakeE2Manager) GetRegistrationCallCount() int
- func (f *FakeE2Manager) ListE2Nodes(ctx context.Context) ([]*e2.E2Node, error)
- func (f *FakeE2Manager) ProvisionNode(ctx context.Context, spec nephoranv1.E2NodeSetSpec) error
- func (f *FakeE2Manager) RegisterE2Node(ctx context.Context, nodeID string, ranFunctions []e2.RanFunction) error
- func (f *FakeE2Manager) Reset()
- func (f *FakeE2Manager) SendControlMessage(ctx context.Context, nodeID string, controlReq *e2.RICControlRequest) (*e2.RICControlAcknowledge, error)
- func (f *FakeE2Manager) SetShouldFailConnection(fail bool)
- func (f *FakeE2Manager) SetShouldFailDeregistration(fail bool)
- func (f *FakeE2Manager) SetShouldFailList(fail bool)
- func (f *FakeE2Manager) SetShouldFailProvision(fail bool)
- func (f *FakeE2Manager) SetShouldFailRegistration(fail bool)
- func (f *FakeE2Manager) SetupE2Connection(nodeID string, endpoint string) error
- func (f *FakeE2Manager) Shutdown() error
- func (f *FakeE2Manager) SubscribeE2(req *e2.E2SubscriptionRequest) (*e2.E2Subscription, error)
Constants ¶
View Source
const ( TestTimeout = time.Second * 30 TestInterval = time.Millisecond * 250 DefaultReplicas = int32(3) DefaultTestEndpoint = "http://localhost:8080" DefaultGitRepoURL = "https://github.com/test/deployments.git" DefaultGitBranch = "main" DefaultGitDeployPath = "networkintents" DefaultMaxRetries = 3 DefaultRetryDelay = time.Second * 1 DefaultHTTPTimeout = 30 * time.Second DefaultRequeueAfter = 30 * time.Second TestE2NodeSetName = "test-e2nodeset" TestNetworkIntentName = "test-networkintent" TestNamespacePrefix = "test-ns" TestAppLabel = "test-app" TestAppName = "test-e2node" TestFunctionID = 1 TestFunctionOID = "1.3.6.1.4.1.1.1.1.1" TestServiceModel = "kpm" TestFunctionDesc = "Test function" TestBandwidth = "100Mbps" TestLatency = "10ms" TestIntentType = "qos" TestPriority = 1 )
Variables ¶
This section is empty.
Functions ¶
func CreateIsolatedNamespace ¶
func CreateTestE2NodeSet ¶
func CreateTestE2NodeSet(name, namespace string, replicas int32) *nephoranv1.E2NodeSet
func CreateTestNamespace ¶
func CreateTestNetworkIntent ¶
func CreateTestNetworkIntent(name, namespace string) *nephoranv1.NetworkIntent
func DeleteTestNamespace ¶
func EnsureResourceDeleted ¶
func EnsureResourceExists ¶
func GetCondition ¶
func GetConditionByType ¶
func GetConditionStatus ¶
func GetConditionStatus(conditions []metav1.Condition, conditionType string) metav1.ConditionStatus
func GetRetryCount ¶
func GetRetryCount(ni *nephoranv1.NetworkIntent, operation string) int
func IsConditionFalse ¶
func IsConditionTrue ¶
func IsConditionUnknown ¶
Types ¶
type FakeE2Manager ¶
type FakeE2Manager struct {
// contains filtered or unexported fields
}
func NewFakeE2Manager ¶
func NewFakeE2Manager() *FakeE2Manager
func (*FakeE2Manager) DeregisterE2Node ¶
func (f *FakeE2Manager) DeregisterE2Node(ctx context.Context, nodeID string) error
func (*FakeE2Manager) GetConnectionCallCount ¶
func (f *FakeE2Manager) GetConnectionCallCount() int
func (*FakeE2Manager) GetConnections ¶
func (f *FakeE2Manager) GetConnections() map[string]string
func (*FakeE2Manager) GetDeregistrationCallCount ¶
func (f *FakeE2Manager) GetDeregistrationCallCount() int
func (*FakeE2Manager) GetLastProvisionedSpec ¶
func (f *FakeE2Manager) GetLastProvisionedSpec() nephoranv1.E2NodeSetSpec
func (*FakeE2Manager) GetListCallCount ¶
func (f *FakeE2Manager) GetListCallCount() int
func (*FakeE2Manager) GetMetrics ¶
func (f *FakeE2Manager) GetMetrics() *e2.E2Metrics
GetMetrics returns fake E2 metrics for testing
func (*FakeE2Manager) GetProvisionCallCount ¶
func (f *FakeE2Manager) GetProvisionCallCount() int
func (*FakeE2Manager) GetRegistrationCallCount ¶
func (f *FakeE2Manager) GetRegistrationCallCount() int
func (*FakeE2Manager) ListE2Nodes ¶
func (*FakeE2Manager) ProvisionNode ¶
func (f *FakeE2Manager) ProvisionNode(ctx context.Context, spec nephoranv1.E2NodeSetSpec) error
func (*FakeE2Manager) RegisterE2Node ¶
func (f *FakeE2Manager) RegisterE2Node(ctx context.Context, nodeID string, ranFunctions []e2.RanFunction) error
func (*FakeE2Manager) Reset ¶
func (f *FakeE2Manager) Reset()
func (*FakeE2Manager) SendControlMessage ¶
func (f *FakeE2Manager) SendControlMessage(ctx context.Context, nodeID string, controlReq *e2.RICControlRequest) (*e2.RICControlAcknowledge, error)
SendControlMessage sends a fake control message for testing
func (*FakeE2Manager) SetShouldFailConnection ¶
func (f *FakeE2Manager) SetShouldFailConnection(fail bool)
func (*FakeE2Manager) SetShouldFailDeregistration ¶
func (f *FakeE2Manager) SetShouldFailDeregistration(fail bool)
func (*FakeE2Manager) SetShouldFailList ¶
func (f *FakeE2Manager) SetShouldFailList(fail bool)
func (*FakeE2Manager) SetShouldFailProvision ¶
func (f *FakeE2Manager) SetShouldFailProvision(fail bool)
func (*FakeE2Manager) SetShouldFailRegistration ¶
func (f *FakeE2Manager) SetShouldFailRegistration(fail bool)
func (*FakeE2Manager) SetupE2Connection ¶
func (f *FakeE2Manager) SetupE2Connection(nodeID string, endpoint string) error
func (*FakeE2Manager) Shutdown ¶
func (f *FakeE2Manager) Shutdown() error
Shutdown gracefully shuts down the fake manager
func (*FakeE2Manager) SubscribeE2 ¶
func (f *FakeE2Manager) SubscribeE2(req *e2.E2SubscriptionRequest) (*e2.E2Subscription, error)
SubscribeE2 creates a fake subscription for testing
Click to show internal directories.
Click to hide internal directories.