testing

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CreateRuleRequest = `
{
  "description": "Default security group",
  "direction": "egress",
  "ethertype": "IPv4",
  "protocol": "tcp"
}
`
View Source
const CreateRuleResponse = `` /* 413-byte string literal not displayed */
View Source
const DeepCopyRequest = `
{
  "name": "default"
}
`
View Source
const MetadataCreateRequest = `
{
"test1": "test1", 
"test2": "test2"
}
`
View Source
const MetadataListResponse = `` /* 215-byte string literal not displayed */
View Source
const MetadataResponse = `
{
  "key": "some_key",
  "value": "some_val",
  "read_only": false
}
`
View Source
const ResourceMetadataRequest = `
{
"some_key": "some_val"
}
`
View Source
const UpdateRequest = `` /* 274-byte string literal not displayed */

Variables

View Source
var (
	SecurityGroup1 = securitygroups.SecurityGroup{
		Name:           groupName,
		Description:    groupDescription,
		ID:             groupID,
		CreatedAt:      groupCreatedTime,
		UpdatedAt:      &groupUpdatedTime,
		RevisionNumber: 4,
		SecurityGroupRules: []securitygroups.SecurityGroupRule{
			{
				ID:              groupRuleID,
				SecurityGroupID: groupID,
				Direction:       direction,
				RemoteGroupID:   nil,
				EtherType:       &eitherType,
				Protocol:        &sgProto,
				PortRangeMax:    nil,
				PortRangeMin:    nil,
				Description:     nil,
				RemoteIPPrefix:  nil,
				CreatedAt:       groupCreatedTime,
				UpdatedAt:       &groupUpdatedTime,
				RevisionNumber:  0,
			},
			{
				ID:              groupRuleID,
				SecurityGroupID: groupID,
				Direction:       direction,
				RemoteGroupID:   nil,
				EtherType:       &eitherType,
				Protocol:        &sgProto2,
				PortRangeMax:    nil,
				PortRangeMin:    nil,
				Description:     nil,
				RemoteIPPrefix:  nil,
				CreatedAt:       groupCreatedTime,
				UpdatedAt:       &groupUpdatedTime,
				RevisionNumber:  0,
			},
		},
		ProjectID: fake.ProjectID,
		RegionID:  fake.RegionID,
		Region:    "Luxembourg 1",
		Metadata:  []securitygroups.Metadata{ResourceMetadataReadOnly},
	}

	ExpectedSecurityGroupSlice = []securitygroups.SecurityGroup{SecurityGroup1}

	ResourceMetadata = map[string]interface{}{
		"some_key": "some_val",
	}

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

	Metadata1 = securitygroups.Metadata{
		Key:      "cost-center",
		Value:    "Atlanta",
		ReadOnly: false,
	}
	Metadata2 = securitygroups.Metadata{
		Key:      "data-center",
		Value:    "A",
		ReadOnly: false,
	}
	ExpectedMetadataList = []securitygroups.Metadata{Metadata1, Metadata2}
)
View Source
var CreateRequest = fmt.Sprintf(`
{
  "instances": [
    "8dc30d49-bb34-4920-9bbd-03a2587ec0ad",
    "a7e7e8d6-0bf7-4ac9-8170-831b47ee2ba9"
  ],
  "security_group": {
    "description": "Default security group",
    "name": "default",
    "security_group_rules": [],
	"metadata": %s
  }
}
`, ResourceMetadataRequest)
View Source
var CreateResponse = fmt.Sprintf(`
{
  "description": "Default security group",
  "updated_at": "2019-07-26T13:25:03+0000",
  "name": "default",
  "metadata": [%s],	
  "security_group_rules": [
	{
	  "description": null,
	  "direction": "egress",
	  "port_range_max": null,
	  "updated_at": "2019-07-26T13:25:03+0000",
	  "remote_group_id": null,
	  "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
	  "protocol": "0",
	  "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
	  "remote_ip_prefix": null,
	  "port_range_min": null,
	  "revision_number": 0,
	  "created_at": "2019-07-26T13:25:03+0000",
	  "ethertype": "IPv4"
	},
	{
	  "description": null,
	  "direction": "egress",
	  "port_range_max": null,
	  "updated_at": "2019-07-26T13:25:03+0000",
	  "remote_group_id": null,
	  "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
	  "protocol": "50",
	  "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
	  "remote_ip_prefix": null,
	  "port_range_min": null,
	  "revision_number": 0,
	  "created_at": "2019-07-26T13:25:03+0000",
	  "ethertype": "IPv4"
	}
  ],
  "id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
  "revision_number": 4,
  "created_at": "2019-07-26T13:25:03+0000",
  "region": "Luxembourg 1",
  "project_id": 1,
  "region_id": 1
}
`, MetadataResponse)
View Source
var GetResponse = fmt.Sprintf(`
{
  "description": "Default security group",
  "updated_at": "2019-07-26T13:25:03+0000",
  "name": "default",
  "metadata": [%s],
  "security_group_rules": [
	{
	  "description": null,
	  "direction": "egress",
	  "port_range_max": null,
	  "updated_at": "2019-07-26T13:25:03+0000",
	  "remote_group_id": null,
	  "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
	  "protocol": "0",
	  "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
	  "remote_ip_prefix": null,
	  "port_range_min": null,
	  "revision_number": 0,
	  "created_at": "2019-07-26T13:25:03+0000",
	  "ethertype": "IPv4"
	},
	{
	  "description": null,
	  "direction": "egress",
	  "port_range_max": null,
	  "updated_at": "2019-07-26T13:25:03+0000",
	  "remote_group_id": null,
	  "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
	  "protocol": "50",
	  "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
	  "remote_ip_prefix": null,
	  "port_range_min": null,
	  "revision_number": 0,
	  "created_at": "2019-07-26T13:25:03+0000",
	  "ethertype": "IPv4"
	}
  ],
  "id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
  "revision_number": 4,
  "created_at": "2019-07-26T13:25:03+0000",
  "region": "Luxembourg 1",
  "project_id": 1,
  "region_id": 1
}
`, MetadataResponse)
View Source
var ListResponse = fmt.Sprintf(`
{
  "count": 1,
  "results": [
    {
      "description": "Default security group",
      "updated_at": "2019-07-26T13:25:03+0000",
      "name": "default",
      "security_group_rules": [
        {
          "description": null,
          "direction": "egress",
          "port_range_max": null,
          "updated_at": "2019-07-26T13:25:03+0000",
          "remote_group_id": null,
          "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
          "protocol": "0",
          "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
          "remote_ip_prefix": null,
          "port_range_min": null,
          "revision_number": 0,
          "created_at": "2019-07-26T13:25:03+0000",
          "ethertype": "IPv4"
        },
        {
          "description": null,
          "direction": "egress",
          "port_range_max": null,
          "updated_at": "2019-07-26T13:25:03+0000",
          "remote_group_id": null,
          "id": "253c1ad7-8061-44b9-9f33-5616ad8ba5b6",
          "protocol": "50",
          "security_group_id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
          "remote_ip_prefix": null,
          "port_range_min": null,
          "revision_number": 0,
          "created_at": "2019-07-26T13:25:03+0000",
          "ethertype": "IPv4"
        }
      ],
      "id": "3addc7a1-e926-46da-b5a2-eb4b2f935230",
      "revision_number": 4,
      "created_at": "2019-07-26T13:25:03+0000",
      "region": "Luxembourg 1",
      "project_id": 1,
      "region_id": 1,
	  "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