Documentation ¶
Overview ¶
Package config contains APIs for configuring DUTs.
Index ¶
- type VendorConfig
- func (c *VendorConfig) Append(t testing.TB)
- func (c *VendorConfig) Push(t testing.TB)
- func (c *VendorConfig) String() string
- func (c *VendorConfig) WithAristaFile(path string) *VendorConfig
- func (c *VendorConfig) WithAristaText(text string) *VendorConfig
- func (c *VendorConfig) WithCiscoFile(path string) *VendorConfig
- func (c *VendorConfig) WithCiscoText(text string) *VendorConfig
- func (c *VendorConfig) WithFile(path string) *VendorConfig
- func (c *VendorConfig) WithJuniperFile(path string) *VendorConfig
- func (c *VendorConfig) WithJuniperText(text string) *VendorConfig
- func (c *VendorConfig) WithText(text string) *VendorConfig
- func (c *VendorConfig) WithVarMap(m map[string]string) *VendorConfig
- func (c *VendorConfig) WithVarValue(key, value string) *VendorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VendorConfig ¶
type VendorConfig struct {
// contains filtered or unexported fields
}
VendorConfig is a vendor configuration for a DUT.
func NewVendorConfig ¶
func NewVendorConfig(dut binding.DUT) *VendorConfig
NewVendorConfig returns a new vendor configuration for a DUT. Tests must not call this method directly.
func (*VendorConfig) Append ¶
func (c *VendorConfig) Append(t testing.TB)
Append appends the specified config to the current config.
func (*VendorConfig) Push ¶
func (c *VendorConfig) Push(t testing.TB)
Push resets the device to its base config and appends the specified config.
func (*VendorConfig) String ¶
func (c *VendorConfig) String() string
func (*VendorConfig) WithAristaFile ¶
func (c *VendorConfig) WithAristaFile(path string) *VendorConfig
WithAristaFile sets the config to be pushed if the DUT vendor is Arista.
func (*VendorConfig) WithAristaText ¶
func (c *VendorConfig) WithAristaText(text string) *VendorConfig
WithAristaText sets the config to be pushed if the DUT vendor is Arista.
func (*VendorConfig) WithCiscoFile ¶
func (c *VendorConfig) WithCiscoFile(path string) *VendorConfig
WithCiscoFile sets the config to be pushed if the DUT vendor is Cisco.
func (*VendorConfig) WithCiscoText ¶
func (c *VendorConfig) WithCiscoText(text string) *VendorConfig
WithCiscoText sets the config to be pushed if the DUT vendor is Cisco.
func (*VendorConfig) WithFile ¶
func (c *VendorConfig) WithFile(path string) *VendorConfig
WithFile sets the config to be pushed regardless of the DUT vendor. This should only be used when the DUT vendor was already taken into account in the generation of the config and only when no per-vendor configs are set.
func (*VendorConfig) WithJuniperFile ¶
func (c *VendorConfig) WithJuniperFile(path string) *VendorConfig
WithJuniperFile sets the config to be pushed if the DUT vendor is Juniper.
func (*VendorConfig) WithJuniperText ¶
func (c *VendorConfig) WithJuniperText(text string) *VendorConfig
WithJuniperText sets the config to be pushed if the DUT vendor is Juniper.
func (*VendorConfig) WithText ¶
func (c *VendorConfig) WithText(text string) *VendorConfig
WithText sets the config to be pushed regardless of the DUT vendor. This should only be used when the DUT vendor was already taken into account in the generation of the config and only when no per-vendor configs are set.
func (*VendorConfig) WithVarMap ¶
func (c *VendorConfig) WithVarMap(m map[string]string) *VendorConfig
WithVarMap sets the map used to replace each occurrence of {{ var "key" }} in the pushed config.
func (*VendorConfig) WithVarValue ¶
func (c *VendorConfig) WithVarValue(key, value string) *VendorConfig
WithVarValue replaces each occurrence of {{ var "key" }} in the pushed config with the specified value.