Documentation ¶
Overview ¶
Package testing contains virtual storage unit tests
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateRequest = fmt.Sprintf(`
{
"virtual_storage": {
"volume_type_id": "%s",
"name": "%s",
"description": "%s",
"network_id": "%s",
"subnet_id": "%s",
"ip_addr_pool": {
"start": "%s",
"end": "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
}]
}
}`, idVolumeType,
nameVirtualStorage1,
descriptionVirtualStorage1,
networkID,
subnetID,
ipAddrPoolStart,
ipAddrPoolEnd,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
)
CreateRequest is mocked request for virtualstorages.Create
View Source
var CreateResponse = fmt.Sprintf(`
{
"virtual_storage": {
"id": "%s",
"volume_type_id": "%s",
"name": "%s",
"description": "%s",
"network_id": "%s",
"subnet_id": "%s",
"ip_addr_pool": {
"start": "%s",
"end": "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
}],
"status": "creating",
"created_at": "null",
"error_message": ""
}
}`, idVirtualStorage1,
idVolumeType,
nameVirtualStorage1,
descriptionVirtualStorage1,
networkID,
subnetID,
ipAddrPoolStart,
ipAddrPoolEnd,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
)
CreateResponse is mocked response of virtualstorages.Create
View Source
var GetResponse = fmt.Sprintf(`
{
"virtual_storage": {
"id": "%s",
"volume_type_id": "%s",
"name": "%s",
"description": "%s",
"network_id": "%s",
"subnet_id": "%s",
"ip_addr_pool": {
"start": "%s",
"end": "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
}],
"status": "available",
"created_at": "%s",
"updated_at" : "%s",
"error_message": ""
}
}`, idVirtualStorage1,
idVolumeType,
nameVirtualStorage1,
descriptionVirtualStorage1,
networkID,
subnetID,
ipAddrPoolStart,
ipAddrPoolEnd,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
storageTime,
storageTime)
GetResponse is mocked format of virtualstorages.Get
View Source
var ListResponse = fmt.Sprintf(`
{
"virtual_storages": [
{
"id" : "%s",
"volume_type_id" : "%s",
"name" : "%s",
"description" : "%s",
"tenant_id" : "%s",
"network_id" : "%s",
"subnet_id" : "%s",
"ip_addr_pool" : {
"start" : "%s",
"end" : "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination":"%s",
"nexthop": "%s"
}],
"status" : "available",
"links": [{
"href": "http://storage.sdp.url:port/v1.0/virtual_storages/440cf918-3ee0-4143-b289-f63e1d2000e6",
"rel": "self"
}],
"created_at" : "%s",
"updated_at" : "%s"
},
{
"id" : "%s",
"volume_type_id" : "%s",
"name" : "virtual_storage_name_2",
"description" : "virtual_storage_description_2",
"tenant_id" : "%s",
"network_id" : "%s",
"subnet_id" : "%s",
"ip_addr_pool" : {
"start" : "%s",
"end" : "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination":"%s",
"nexthop": "%s"
}],
"status": "available",
"links": [{
"href": "http://storage.sdp.url:port/v1.0/virtual_storages/440cf918-3ee0-4143-b289-f63e1d2000e6",
"rel": "self"
}],
"created_at" : "%s",
"updated_at" : "%s"
}
]
}`,
idVirtualStorage1,
idVolumeType,
nameVirtualStorage1,
descriptionVirtualStorage1,
tenantID,
networkID,
subnetID,
ipAddrPoolStart,
ipAddrPoolEnd,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
storageTime,
storageTime,
idVirtualStorage1,
idVolumeType,
tenantID,
networkID,
subnetID,
ipAddrPoolStart,
ipAddrPoolEnd,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
storageTime,
storageTime)
ListResponse is mocked response of virtualstorages.List
View Source
var UpdateRequest = fmt.Sprintf(`
{
"virtual_storage": {
"name": "%s",
"description": "%s",
"ip_addr_pool": {
"start": "%s",
"end": "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
}]
}
}`, nameVirtualStorage1Update,
descriptionVirtualStorage1Update,
ipAddrPoolStartUpdate,
ipAddrPoolEndUpdate,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
hostRoute3Destination,
hostRoute3Nexthop,
)
UpdateRequest is mocked request of virtualstorages.Update
View Source
var UpdateResponse = fmt.Sprintf(`
{
"virtual_storage": {
"id": "%s",
"volume_type_id": "%s",
"name": "%s",
"description": "%s",
"network_id": "%s",
"subnet_id": "%s",
"ip_addr_pool": {
"start": "%s",
"end": "%s"
},
"host_routes":[{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
},
{
"destination": "%s",
"nexthop": "%s"
}],
"status": "available",
"created_at": "%s",
"updated_at" : "%s",
"error_message": ""
}
}`, idVirtualStorage1,
idVolumeType,
nameVirtualStorage1Update,
descriptionVirtualStorage1Update,
networkID,
subnetID,
ipAddrPoolStartUpdate,
ipAddrPoolEndUpdate,
hostRoute1Destination,
hostRoute1Nexthop,
hostRoute2Destination,
hostRoute2Nexthop,
hostRoute3Destination,
hostRoute3Nexthop,
storageTime,
storageTime)
UpdateResponse is mocked response of virtualstorages.Update
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.