Documentation ¶
Overview ¶
loadbalancers unit tests
Index ¶
- Constants
- Variables
- func HandleLoadbalancerCreationSuccessfully(t *testing.T, response string)
- func HandleLoadbalancerDeletionSuccessfully(t *testing.T)
- func HandleLoadbalancerFailoverSuccessfully(t *testing.T)
- func HandleLoadbalancerGetStatsTree(t *testing.T)
- func HandleLoadbalancerGetStatusesTree(t *testing.T)
- func HandleLoadbalancerGetSuccessfully(t *testing.T)
- func HandleLoadbalancerListSuccessfully(t *testing.T)
- func HandleLoadbalancerUpdateSuccessfully(t *testing.T)
Constants ¶
const GetLoadbalancerStatsBody = `` /* 176-byte string literal not displayed */
LoadbalancerStatsTree is the canned request body of a Get request on loadbalancer's statistics.
const GetLoadbalancerStatusesBody = `` /* 821-byte string literal not displayed */
GetLoadbalancerStatusesBody is the canned request body of a Get request on loadbalancer's status.
const LoadbalancersListBody = `` /* 1060-byte string literal not displayed */
LoadbalancersListBody contains the canned body of a loadbalancer list response.
const PostUpdateLoadbalancerBody = `` /* 527-byte string literal not displayed */
PostUpdateLoadbalancerBody is the canned response body of a Update request on an existing loadbalancer.
const SingleLoadbalancerBody = `` /* 522-byte string literal not displayed */
SingleLoadbalancerBody is the canned body of a Get request on an existing loadbalancer.
Variables ¶
var ( LoadbalancerWeb = loadbalancers.LoadBalancer{ ID: "c331058c-6a40-4144-948e-b9fb1df9db4b", ProjectID: "54030507-44f7-473c-9342-b4d14a95f692", Name: "web_lb", Description: "lb config for the web tier", VipSubnetID: "8a49c438-848f-467b-9655-ea1548708154", VipAddress: "10.30.176.47", VipPortID: "2a22e552-a347-44fd-b530-1f2b1b2a6735", Flavor: "small", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "ACTIVE", OperatingStatus: "ONLINE", Tags: []string{"test", "stage"}, } LoadbalancerDb = loadbalancers.LoadBalancer{ ID: "36e08a3e-a78f-4b40-a229-1e7e23eee1ab", ProjectID: "54030507-44f7-473c-9342-b4d14a95f692", Name: "db_lb", Description: "lb config for the db tier", VipSubnetID: "9cedb85d-0759-4898-8a4b-fa5a5ea10086", VipAddress: "10.30.176.48", VipPortID: "2bf413c8-41a9-4477-b505-333d5cbe8b55", Flavor: "medium", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "PENDING_CREATE", OperatingStatus: "OFFLINE", Tags: []string{"test", "stage"}, } LoadbalancerUpdated = loadbalancers.LoadBalancer{ ID: "36e08a3e-a78f-4b40-a229-1e7e23eee1ab", ProjectID: "54030507-44f7-473c-9342-b4d14a95f692", Name: "NewLoadbalancerName", Description: "lb config for the db tier", VipSubnetID: "9cedb85d-0759-4898-8a4b-fa5a5ea10086", VipAddress: "10.30.176.48", VipPortID: "2bf413c8-41a9-4477-b505-333d5cbe8b55", Flavor: "medium", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "PENDING_CREATE", OperatingStatus: "OFFLINE", Tags: []string{"test"}, } LoadbalancerStatusesTree = loadbalancers.StatusTree{ Loadbalancer: &loadbalancers.LoadBalancer{ ID: "36e08a3e-a78f-4b40-a229-1e7e23eee1ab", Name: "db_lb", ProvisioningStatus: "PENDING_UPDATE", OperatingStatus: "ACTIVE", Tags: []string{"test", "stage"}, Listeners: []listeners.Listener{{ ID: "db902c0c-d5ff-4753-b465-668ad9656918", Name: "db", ProvisioningStatus: "ACTIVE", Pools: []pools.Pool{{ ID: "fad389a3-9a4a-4762-a365-8c7038508b5d", Name: "db", ProvisioningStatus: "ACTIVE", Monitor: monitors.Monitor{ ID: "67306cda-815d-4354-9fe4-59e09da9c3c5", Type: "PING", ProvisioningStatus: "ACTIVE", }, Members: []pools.Member{{ ID: "2a280670-c202-4b0b-a562-34077415aabf", Name: "db", Address: "10.0.2.11", ProtocolPort: 80, ProvisioningStatus: "ACTIVE", }}, }}, }}, }, } LoadbalancerStatsTree = loadbalancers.Stats{ ActiveConnections: 0, BytesIn: 9532, BytesOut: 22033, RequestErrors: 46, TotalConnections: 112, } )
Functions ¶
func HandleLoadbalancerCreationSuccessfully ¶
HandleLoadbalancerCreationSuccessfully sets up the test server to respond to a loadbalancer creation request with a given response.
func HandleLoadbalancerDeletionSuccessfully ¶
HandleLoadbalancerDeletionSuccessfully sets up the test server to respond to a loadbalancer deletion request.
func HandleLoadbalancerFailoverSuccessfully ¶
HandleLoadbalancerFailoverSuccessfully sets up the test server to respond to a loadbalancer failover request.
func HandleLoadbalancerGetStatsTree ¶
HandleLoadbalancerGetStatsTree sets up the test server to respond to a loadbalancer Get stats tree request.
func HandleLoadbalancerGetStatusesTree ¶
HandleLoadbalancerGetStatusesTree sets up the test server to respond to a loadbalancer Get statuses tree request.
func HandleLoadbalancerGetSuccessfully ¶
HandleLoadbalancerGetSuccessfully sets up the test server to respond to a loadbalancer Get request.
func HandleLoadbalancerListSuccessfully ¶
HandleLoadbalancerListSuccessfully sets up the test server to respond to a loadbalancer List request.
func HandleLoadbalancerUpdateSuccessfully ¶
HandleLoadbalancerUpdateSuccessfully sets up the test server to respond to a loadbalancer Update request.
Types ¶
This section is empty.