testing

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MPL-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 MetadataCreateRequest = `
{
  "tags": {
    "test1": "test1",
    "test2": "test2"
  }
}
`
View Source
const MetadataDeleteRequest = `
{
  "tags": {
    "cost-center": null
  }
}
`
View Source
const MetadataGetResponse = `` /* 333-byte string literal not displayed */

MetadataGetResponse is a subnet with two user tags and one read-only tag

View Source
const MetadataReplaceRequest = `
{
  "tags": {
    "cost-center": "Boston",
    "data-center": null,
    "test1": "test1"
  }
}
`

MetadataReplaceRequest keeps cost-center with a new value, adds test1, removes data-center and does not send the read-only owner

View Source
const MetadataResponse = `
{
  "key": "some_key",
  "value": "some_val",
  "read_only": false
}
`
View Source
const UpdateRequestGW = `
{
 	"name": "subnet",
    "enable_dhcp": true,
    "dns_nameservers": null,
    "host_routes": null
}
`
View Source
const UpdateRequestNoData = `
{
    "dns_nameservers": [],
    "host_routes": [],
    "gateway_ip": null
}
`
View Source
const UpdateRequestNoGW = `
{
 	"name": "subnet",
 	"gateway_ip": null,
    "dns_nameservers": null,
    "host_routes": null
}
`
View Source
const UpdateRequestTags = `` /* 146-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},
		},
		Metadata: []metadata.Metadata{ResourceMetadataReadOnly},
	}
	Tasks1 = tasks.TaskResults{
		Tasks: []tasks.TaskID{"50f53a35-42ed-40c4-82b2-5a37fb3e00bc"},
	}

	ExpectedSubnetSlice = []subnets.Subnet{Subnet1}

	ResourceMetadataReadOnly = metadata.Metadata{
		Key:      "some_key",
		Value:    "some_val",
		ReadOnly: false,
	}

	Metadata1 = metadata.Metadata{
		Key:      "cost-center",
		Value:    "Atlanta",
		ReadOnly: false,
	}
	Metadata2 = metadata.Metadata{
		Key:      "data-center",
		Value:    "A",
		ReadOnly: false,
	}
	MetadataReadOnly = metadata.Metadata{
		Key:      "owner",
		Value:    "gcore",
		ReadOnly: true,
	}
	ExpectedMetadataList = []metadata.Metadata{Metadata1, Metadata2, MetadataReadOnly}
)
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": 7.922816251426434e+28,
  "total_ips": 18446744073709552000,
  "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"
    }
  ],
  "metadata": [%s]
}
`, MetadataResponse)
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": 7.922816251426434e+28,
		  "total_ips": 18446744073709552000,
		  "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"
			}
		  ],
          "metadata": [%s]
    	}
  	]
}
`, MetadataResponse)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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