Documentation ¶
Overview ¶
loadbalancers unit tests
Index ¶
- Constants
- Variables
- func HandleLoadbalancerCreationSuccessfully(t *testing.T, response string)
- func HandleLoadbalancerDeletionSuccessfully(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 LoadbalancerStatuesesTree = `` /* 1460-byte string literal not displayed */
SingleLoadbalancerBody is the canned body of a Get request on an existing loadbalancer.
const LoadbalancersListBody = `` /* 953-byte string literal not displayed */
LoadbalancersListBody contains the canned body of a loadbalancer list response.
const PostUpdateLoadbalancerBody = `` /* 484-byte string literal not displayed */
PostUpdateLoadbalancerBody is the canned response body of a Update request on an existing loadbalancer.
const SingleLoadbalancerBody = `` /* 470-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", TenantID: "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", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "ACTIVE", OperatingStatus: "ONLINE", } LoadbalancerDb = loadbalancers.LoadBalancer{ ID: "36e08a3e-a78f-4b40-a229-1e7e23eee1ab", TenantID: "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", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "PENDING_CREATE", OperatingStatus: "OFFLINE", } LoadbalancerUpdated = loadbalancers.LoadBalancer{ ID: "36e08a3e-a78f-4b40-a229-1e7e23eee1ab", TenantID: "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", Provider: "haproxy", AdminStateUp: true, ProvisioningStatus: "PENDING_CREATE", OperatingStatus: "OFFLINE", } LoadbalancerStatuses = loadbalancers.LoadbalancerStatus{ ID: "38278031-cfca-44be-81be-a412f618773b", Name: "lb-jy", OperatingStatus: "ONLINE", ProvisioningStatus: "ACTIVE", Listeners: []loadbalancers.Listener{{ Name: "listener-jy-1", ProvisioningStatus: "ACTIVE", Pools: []loadbalancers.Pool{{ ID: "c54b3286-2349-4c5c-ade1-e6bb0b26ad18", OperatingStatus: "ONLINE", Name: "pool-jy-1", ProvisioningStatus: "ACTIVE", HealthMonitor: loadbalancers.HealthMonitor{ Type: "TCP", ID: "7422b51a-0ed2-4702-9429-4f88349276c6", Name: "", ProvisioningStatus: "ACTIVE", }, Members: []loadbalancers.Member{{ ProtocolPort: 80, Address: "192.168.44.11", ID: "7bbf7151-0dce-4087-b316-06c7fa17b894", OperatingStatus: "ONLINE", ProvisioningStatus: "ACTIVE", }}, }}, L7Policies: []interface{}{}, ID: "eb84c5b4-9bc5-4bee-939d-3900fb05dc7b", OperatingStatus: "ONLINE", }}, Pools: []loadbalancers.Pool{{ ID: "38278031-cfca-44be-81be-a412f618773b", OperatingStatus: "ONLINE", Name: "pool-jy-1", ProvisioningStatus: "ACTIVE", HealthMonitor: loadbalancers.HealthMonitor{ Type: "TCP", ID: "7422b51a-0ed2-4702-9429-4f88349276c6", Name: "", ProvisioningStatus: "ACTIVE", }, Members: []loadbalancers.Member{{ ProtocolPort: 80, Address: "192.168.44.11", ID: "7bbf7151-0dce-4087-b316-06c7fa17b894", OperatingStatus: "ONLINE", ProvisioningStatus: "ACTIVE", }}, }, }, } )
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 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.