testinfra

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Chdir          string            `mapstructure:"chdir" required:"false"`
	Compact        bool              `mapstructure:"compact" required:"false"`
	DestinationDir string            `mapstructure:"destination_dir" required:"false"`
	EnvVars        map[string]string `mapstructure:"env_vars" required:"false"`
	InstallCmd     []string          `mapstructure:"install_cmd" required:"false"`
	Keyword        string            `mapstructure:"keyword" required:"false"`
	Local          bool              `mapstructure:"local" required:"false"`
	Marker         string            `mapstructure:"marker" required:"false"`
	Parallel       bool              `mapstructure:"parallel" required:"false"`
	PytestPath     string            `mapstructure:"pytest_path" required:"false"`
	Sudo           bool              `mapstructure:"sudo" required:"false"`
	SudoUser       string            `mapstructure:"sudo_user" required:"false"`
	TestFiles      []string          `mapstructure:"test_files" required:"false"`
	Verbose        int               `mapstructure:"verbose" required:"false"`
	// contains filtered or unexported fields
}

config data deserialized/unmarshalled from packer template/config

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatConfig

type FlatConfig struct {
	Chdir          *string           `mapstructure:"chdir" required:"false" cty:"chdir" hcl:"chdir"`
	Compact        *bool             `mapstructure:"compact" required:"false" cty:"compact" hcl:"compact"`
	DestinationDir *string           `mapstructure:"destination_dir" required:"false" cty:"destination_dir" hcl:"destination_dir"`
	EnvVars        map[string]string `mapstructure:"env_vars" required:"false" cty:"env_vars" hcl:"env_vars"`
	InstallCmd     []string          `mapstructure:"install_cmd" required:"false" cty:"install_cmd" hcl:"install_cmd"`
	Keyword        *string           `mapstructure:"keyword" required:"false" cty:"keyword" hcl:"keyword"`
	Local          *bool             `mapstructure:"local" required:"false" cty:"local" hcl:"local"`
	Marker         *string           `mapstructure:"marker" required:"false" cty:"marker" hcl:"marker"`
	Parallel       *bool             `mapstructure:"parallel" required:"false" cty:"parallel" hcl:"parallel"`
	PytestPath     *string           `mapstructure:"pytest_path" required:"false" cty:"pytest_path" hcl:"pytest_path"`
	Sudo           *bool             `mapstructure:"sudo" required:"false" cty:"sudo" hcl:"sudo"`
	SudoUser       *string           `mapstructure:"sudo_user" required:"false" cty:"sudo_user" hcl:"sudo_user"`
	TestFiles      []string          `mapstructure:"test_files" required:"false" cty:"test_files" hcl:"test_files"`
	Verbose        *int              `mapstructure:"verbose" required:"false" cty:"verbose" hcl:"verbose"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type Provisioner

type Provisioner struct {
	// contains filtered or unexported fields
}

implements the packer.Provisioner interface as testinfra.Provisioner

func (*Provisioner) ConfigSpec

func (provisioner *Provisioner) ConfigSpec() hcldec.ObjectSpec

implements configspec with hcl2spec helper function

func (*Provisioner) Prepare

func (provisioner *Provisioner) Prepare(raws ...any) error

prepares the provisioner plugin

func (*Provisioner) Provision

func (provisioner *Provisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.Communicator, generatedData map[string]any) error

executes the provisioner plugin

Jump to

Keyboard shortcuts

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