testing

package
v0.0.0-...-56e5f01 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

listeners unit tests

Index

Constants

View Source
const GetListenerStatsBody = `` /* 176-byte string literal not displayed */

GetListenerStatsBody is the canned request body of a Get request on listener's statistics.

View Source
const ListenersListBody = `` /* 1596-byte string literal not displayed */

ListenersListBody contains the canned body of a listeners list response.

View Source
const PostUpdateListenerBody = `` /* 879-byte string literal not displayed */

PostUpdateListenerBody is the canned response body of a Update request on an existing listener.

View Source
const SingleListenerBody = `` /* 880-byte string literal not displayed */

SingleServerBody is the canned body of a Get request on an existing listener.

Variables

View Source
var (
	ListenerWeb = listeners.Listener{
		ID:                     "db902c0c-d5ff-4753-b465-668ad9656918",
		ProjectID:              "310df60f-2a10-4ee5-9554-98393092194c",
		Name:                   "web",
		Description:            "listener config for the web tier",
		Loadbalancers:          []listeners.LoadBalancerID{{ID: "53306cda-815d-4354-9444-59e09da9c3c5"}},
		Protocol:               "HTTP",
		ProtocolPort:           80,
		DefaultPoolID:          "fad389a3-9a4a-4762-a365-8c7038508b5d",
		AdminStateUp:           true,
		DefaultTlsContainerRef: "2c433435-20de-4411-84ae-9cc8917def76",
		SniContainerRefs:       []string{"3d328d82-2547-4921-ac2f-61c3b452b5ff", "b3cfd7e3-8c19-455c-8ebb-d78dfd8f7e7d"},
		AllowedCIDRs:           []string{"192.0.2.0/24", "198.51.100.0/24"},
		TLSVersions:            []string{"TLSv1.2", "TLSv1.3"},
	}
	ListenerDb = listeners.Listener{
		ID:                     "36e08a3e-a78f-4b40-a229-1e7e23eee1ab",
		ProjectID:              "310df60f-2a10-4ee5-9554-98393092194c",
		Name:                   "db",
		Description:            "listener config for the db tier",
		Loadbalancers:          []listeners.LoadBalancerID{{ID: "79e05663-7f03-45d2-a092-8b94062f22ab"}},
		Protocol:               "TCP",
		ProtocolPort:           3306,
		DefaultPoolID:          "41efe233-7591-43c5-9cf7-923964759f9e",
		ConnLimit:              2000,
		AdminStateUp:           true,
		DefaultTlsContainerRef: "2c433435-20de-4411-84ae-9cc8917def76",
		SniContainerRefs:       []string{"3d328d82-2547-4921-ac2f-61c3b452b5ff", "b3cfd7e3-8c19-455c-8ebb-d78dfd8f7e7d"},
		TimeoutClientData:      50000,
		TimeoutMemberData:      50000,
		TimeoutMemberConnect:   5000,
		TimeoutTCPInspect:      0,
		InsertHeaders:          map[string]string{"X-Forwarded-For": "true"},
		AllowedCIDRs:           []string{"192.0.2.0/24", "198.51.100.0/24"},
		TLSVersions:            []string{"TLSv1.2"},
	}
	ListenerUpdated = listeners.Listener{
		ID:                     "36e08a3e-a78f-4b40-a229-1e7e23eee1ab",
		ProjectID:              "310df60f-2a10-4ee5-9554-98393092194c",
		Name:                   "NewListenerName",
		Description:            "listener config for the db tier",
		Loadbalancers:          []listeners.LoadBalancerID{{ID: "79e05663-7f03-45d2-a092-8b94062f22ab"}},
		Protocol:               "TCP",
		ProtocolPort:           3306,
		DefaultPoolID:          "41efe233-7591-43c5-9cf7-923964759f9e",
		ConnLimit:              1000,
		AdminStateUp:           true,
		DefaultTlsContainerRef: "2c433435-20de-4411-84ae-9cc8917def76",
		SniContainerRefs:       []string{"3d328d82-2547-4921-ac2f-61c3b452b5ff", "b3cfd7e3-8c19-455c-8ebb-d78dfd8f7e7d"},
		TimeoutClientData:      181000,
		TimeoutMemberData:      181000,
		TimeoutMemberConnect:   181000,
		TimeoutTCPInspect:      181000,
		InsertHeaders: map[string]string{
			"X-Forwarded-For":  "true",
			"X-Forwarded-Port": "false",
		},
		TLSVersions: []string{"TLSv1.2", "TLSv1.3"},
	}
	ListenerStatsTree = listeners.Stats{
		ActiveConnections: 0,
		BytesIn:           9532,
		BytesOut:          22033,
		RequestErrors:     46,
		TotalConnections:  112,
	}
)

Functions

func HandleListenerCreationSuccessfully

func HandleListenerCreationSuccessfully(t *testing.T, response string)

HandleListenerCreationSuccessfully sets up the test server to respond to a listener creation request with a given response.

func HandleListenerDeletionSuccessfully

func HandleListenerDeletionSuccessfully(t *testing.T)

HandleListenerDeletionSuccessfully sets up the test server to respond to a listener deletion request.

func HandleListenerGetStatsTree

func HandleListenerGetStatsTree(t *testing.T)

HandleListenerGetStatsTree sets up the test server to respond to a listener Get stats tree request.

func HandleListenerGetSuccessfully

func HandleListenerGetSuccessfully(t *testing.T)

HandleListenerGetSuccessfully sets up the test server to respond to a listener Get request.

func HandleListenerListSuccessfully

func HandleListenerListSuccessfully(t *testing.T)

HandleListenerListSuccessfully sets up the test server to respond to a listener List request.

func HandleListenerUpdateSuccessfully

func HandleListenerUpdateSuccessfully(t *testing.T)

HandleListenerUpdateSuccessfully sets up the test server to respond to a listener Update request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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