Documentation ¶
Overview ¶
subnets unit tests
Index ¶
Constants ¶
View Source
const CreateRequestGW = `` /* 164-byte string literal not displayed */
View Source
const CreateRequestNoGW = `` /* 185-byte string literal not displayed */
View Source
const CreateResponse = `
{
"tasks": [
"50f53a35-42ed-40c4-82b2-5a37fb3e00bc"
]
}
`
View Source
const DeleteResponse = `
{
"tasks": [
"50f53a35-42ed-40c4-82b2-5a37fb3e00bc"
]
}
`
View Source
const UpdateRequestGW = `
{
"name": "subnet",
"enable_dhcp": true,
"dns_nameservers": null,
"host_routes": null
}
`
View Source
const UpdateRequestNoData = `
{
"enable_dhcp": false,
"dns_nameservers": [],
"host_routes": [],
"gateway_ip": null
}
`
View Source
const UpdateRequestNoGW = `` /* 126-byte string literal not displayed */
Variables ¶
View Source
var ( Subnet1 = subnets.Subnet{ ID: "e7944e55-f957-413d-aa56-fdc876543113", Name: "subnet", IPVersion: 4, EnableDHCP: true, CIDR: *cidr, CreatedAt: createdTime, UpdatedAt: updatedTime, NetworkID: "ee2402d0-f0cd-4503-9b75-69be1d11c5f1", TaskID: taskID, CreatorTaskID: taskID, Region: "RegionOne", ProjectID: fake.ProjectID, RegionID: fake.RegionID, AvailableIps: availableIps, TotalIps: totalIps, HasRouter: true, DNSNameservers: []net.IP{ip}, GatewayIP: gwip, HostRoutes: []subnets.HostRoute{ {Destination: *routeCidr, NextHop: ip}, }, } Tasks1 = tasks.TaskResults{ Tasks: []tasks.TaskID{"50f53a35-42ed-40c4-82b2-5a37fb3e00bc"}, } ExpectedSubnetSlice = []subnets.Subnet{Subnet1} )
View Source
var GetResponse = fmt.Sprintf(`
{
"id": "e7944e55-f957-413d-aa56-fdc876543113",
"name": "subnet",
"ip_version": 4,
"enable_dhcp": true,
"cidr": "192.168.10.0/24",
"created_at": "2020-03-05T12:03:24+0000",
"updated_at": "2020-03-05T12:03:25+0000",
"network_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"task_id": "50f53a35-42ed-40c4-82b2-5a37fb3e00bc",
"creator_task_id": "50f53a35-42ed-40c4-82b2-5a37fb3e00bc",
"region": "RegionOne",
"project_id": 1,
"region_id": 1,
"available_ips": %d,
"total_ips": %d,
"dns_nameservers": [
"10.0.0.13"
],
"gateway_ip" : "10.0.0.1",
"has_router": true,
"host_routes": [
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
]
}
`, availableIps, totalIps)
View Source
var ListResponse = fmt.Sprintf(`
{
"count": 1,
"results": [
{
"id": "e7944e55-f957-413d-aa56-fdc876543113",
"name": "subnet",
"ip_version": 4,
"enable_dhcp": true,
"cidr": "192.168.10.0/24",
"created_at": "2020-03-05T12:03:24+0000",
"updated_at": "2020-03-05T12:03:25+0000",
"network_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"task_id": "50f53a35-42ed-40c4-82b2-5a37fb3e00bc",
"creator_task_id": "50f53a35-42ed-40c4-82b2-5a37fb3e00bc",
"region": "RegionOne",
"available_ips": %d,
"total_ips": %d,
"project_id": 1,
"region_id": 1,
"dns_nameservers": [
"10.0.0.13"
],
"gateway_ip" : "10.0.0.1",
"has_router": true,
"host_routes": [
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
]
}
]
}
`, availableIps, totalIps)
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.