testutils

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAliasExists

func CheckAliasExists(expectedName string) resource.TestCheckFunc

CheckAliasExists Given the name of alias, this will return a function that will check whether or not an alias - (1) exists in the state - (2) exist in Proxmox VE - (3) has the correct name

func CheckIPSetExists

CheckIPSetExists Given the name of an IPSet, this will return a function that will check whether or not an IPSet - (1) exists in the state - (2) exist in Proxmox VE - (3) has the correct name

func CheckRole

func CheckRole(expectedPrivileges []string) resource.TestCheckFunc

CheckRole Given the name of role, this will return a function that will check whether or not a role - (1) exists in the state - (2) exist in Proxmox VE - (3) has correct privileges

func GenerateResourceName

func GenerateResourceName() string

GenerateResourceName generates a random name with a constant prefix

func GetProvider

func GetProvider() *schema.Provider

GetProvider returns the proxmox provider

func GetProviders

func GetProviders() map[string]terraform.ResourceProvider

GetProviders returns a map of all providers needed for the project

func HclAliasResource

func HclAliasResource(name string, cidr string, comment string) string

HclAliasResource HCL describing of a PVE alias resource

func HclIPSetResource

func HclIPSetResource(name string, comment string, cidr proxmox.VirtualEnvironmentClusterIPSetContent) string

HclIPSetResource HCL describing of a PVE IPSet resource

func HclIPSetWithAliasResource

func HclIPSetWithAliasResource(name string, comment string, cidr proxmox.VirtualEnvironmentClusterIPSetContent) string

HclIPSetWithAliasResource HCL describing of a PVE IPSet resource with alias

func HclRoleResource

func HclRoleResource(name string, privileges []string) string

HclRoleResource HCL describing of a PVE role resource

func HclVMResource

func HclVMResource(vm map[string]string) string

HclVMResource HCL describing of a PVE VM resource

func PreCheck

func PreCheck(t *testing.T, extraEnvVars *[]string)

PreCheck checks that required environmental variables are set

func ReadVM

readVM is helper function that reads VM

Types

type VMStateAttributes

type VMStateAttributes struct {
	NodeName string
	VMID     int
}

func GetVMFromState

func GetVMFromState(s *terraform.State, resourceName string) (VMStateAttributes, error)

GetVMFromState helper function that retrieves VM Attributes from TF state

Jump to

Keyboard shortcuts

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