testutils

package
v0.0.0-...-fc2a63e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 10 Imported by: 1

README

README for golang-brocade-vyatta-testutils repository

Test utility functions for configd and other golang-brocade repos.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var POISON_SECRETS = []string{
	"PoIsOnSeCrEt", "sEcReTpOiSoN",
}

Well known "secret" values used to detect leaking of secrets

Functions

func Add

func Add(entry string) string

func Cont

func Cont(name string, contEntries ...string) (contStr string)

func CreateFeaturesChecker

func CreateFeaturesChecker(caps string) (compile.FeaturesChecker, error)

Given a file containing a list of feature capabilities, create a directory structure as required by the compiler to determine enabled features A new temporary directory will be created on each invocation

func EmptyLeaf

func EmptyLeaf(name string) string

func FormatAsDiff

func FormatAsDiff(entry string) (diffs string)

Initially the +/- for changed lines get added right in front of the element being changed. This function pulls them to the front of the line and inserts a leading space on unchanged lines. Completely blank lines (other than leading tabs) do NOT get a leading space.

func FormatAsDiffNoTrailingLine

func FormatAsDiffNoTrailingLine(entry string) (diffs string)

func FormatCtxDiffHunk

func FormatCtxDiffHunk(ctxPath, hunk string) string

func GetConfigSchema

func GetConfigSchema(buf ...[]byte) (schema.ModelSet, error)

func GetConfigSchemaSkipUnknown

func GetConfigSchemaSkipUnknown(buf ...[]byte) (schema.ModelSet, error)

func GetFullSchema

func GetFullSchema(buf ...[]byte) (schema.ModelSet, error)

func Leaf

func Leaf(name, value string) string

func LeafList

func LeafList(name string, leafListEntries ...string) (leafListStr string)

func LeafListEntry

func LeafListEntry(name string) string

func List

func List(name string, listEntries ...string) (listStr string)

func ListEntry

func ListEntry(name string, leaves ...string) (listEntryStr string)

func LogStack

func LogStack(t *testing.T)

func LogStackFatal

func LogStackFatal(t *testing.T)

func LogStackInternal

func LogStackInternal(t *testing.T, fatal bool)

func Prefix

func Prefix(entry, pfx string) string

Set of helper functions to produce correctly formatted config and that isolates test code that relies on correctly formatted config from subsequent format changes so that we are testing content not format.

func Rem

func Rem(entry string) string

func Root

func Root(rootEntries ...string) (rootStr string)

func Tab

func Tab(entry string) string

Types

type ModelSetSpec

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

func NewModelSetSpec

func NewModelSetSpec(t *testing.T) *ModelSetSpec

func (*ModelSetSpec) GenerateModelSets

func (mss *ModelSetSpec) GenerateModelSets() (
	schema.ModelSet, schema.ModelSet, error)

func (*ModelSetSpec) GetCfgOnlyModelSet

func (mss *ModelSetSpec) GetCfgOnlyModelSet() schema.ModelSet

func (*ModelSetSpec) GetFullModelSet

func (mss *ModelSetSpec) GetFullModelSet() schema.ModelSet

func (*ModelSetSpec) SetCapabilities

func (mss *ModelSetSpec) SetCapabilities(
	capabilities string,
) *ModelSetSpec

func (*ModelSetSpec) SetExtensions

func (mss *ModelSetSpec) SetExtensions(
	ext *schema.CompilationExtensions,
) *ModelSetSpec

func (*ModelSetSpec) SetFeaturesChecker

func (mss *ModelSetSpec) SetFeaturesChecker(
	checker compile.FeaturesChecker,
) *ModelSetSpec

func (*ModelSetSpec) SetSchemaDir

func (mss *ModelSetSpec) SetSchemaDir(schemaDir string) *ModelSetSpec

func (*ModelSetSpec) SetSchemas

func (mss *ModelSetSpec) SetSchemas(schemas ...[]byte) *ModelSetSpec

func (*ModelSetSpec) SetSkipUnknown

func (mss *ModelSetSpec) SetSkipUnknown() *ModelSetSpec

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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