Documentation
¶
Index ¶
- Variables
- func AddToRoot(ctx context.Context, e api.Entry, updates []*sdcpb.Update, ...) error
- func Config1() *sdcio_schema.Device
- func Config2() *sdcio_schema.Device
- func DiffDoubleStringPathSlice(s1, s2 [][]string) string
- func DiffStringSlice(s1, s2 []string, forceNoSideEffect bool) string
- func DiffUpdates(a []*types.PathAndUpdate, b []*types.Update) string
- func ExpandUpdateFromConfig(ctx context.Context, conf *sdcio_schema.Device, converter *utils.Converter) ([]*sdcpb.Update, error)
- func GetLeafListTvProto(tvs []*sdcpb.TypedValue) *sdcpb.TypedValue
- func GetSchemaClientBound(t *testing.T, mockCtrl *gomock.Controller) (*mockschemaclientbound.MockSchemaClientBound, error)
- func GetStringTvProto(s string) *sdcpb.TypedValue
- func GetTestFilename() string
- func GetUIntTvProto(i uint64) *sdcpb.TypedValue
- func InitSDCIOSchema() (dataschema.Client, *dConfig.SchemaConfig, error)
- func LoadYgotStructIntoTreeRoot(ctx context.Context, gs ygot.GoStruct, root api.Entry, owner string, ...) (*types.ImportStats, error)
- func PathMapIndex(elems []string) string
- func SplitStringSortDiff(a, b string, sep string) string
- func UpdateSliceToStringSlice(s []*types.Update) []string
- type ImportStatsInterface
- type UpdateParentMock
Constants ¶
This section is empty.
Variables ¶
var ( FlagsNew *types.UpdateInsertFlags FlagsExisting *types.UpdateInsertFlags FlagsDelete *types.UpdateInsertFlags )
var (
// location of the test schema from the projects root
SDCIO_SCHEMA_LOCATION = "tests/schema"
)
Functions ¶
func Config1 ¶ added in v0.0.68
func Config1() *sdcio_schema.Device
Config1 returns a test configuration with ethernet-1/1 interface, default network instance, and various test data. Exported for use in other test packages.
func Config2 ¶ added in v0.0.68
func Config2() *sdcio_schema.Device
Config2 returns a test configuration with ethernet-1/2 interface and other network instance. Exported for use in other test packages.
func DiffStringSlice ¶
DiffStringSlice compares two string slices returning the
func DiffUpdates ¶ added in v0.0.56
func DiffUpdates(a []*types.PathAndUpdate, b []*types.Update) string
diffCacheUpdates takes two []*cache.Update and compares the diff
func ExpandUpdateFromConfig ¶ added in v0.0.68
func ExpandUpdateFromConfig(ctx context.Context, conf *sdcio_schema.Device, converter *utils.Converter) ([]*sdcpb.Update, error)
ExpandUpdateFromConfig converts a Ygot GoStruct (Device config) to SDCpb Updates using the provided converter. This is used in tests to convert configuration structures to update messages for the tree.
func GetLeafListTvProto ¶ added in v0.0.40
func GetLeafListTvProto(tvs []*sdcpb.TypedValue) *sdcpb.TypedValue
func GetSchemaClientBound ¶ added in v0.0.44
func GetSchemaClientBound(t *testing.T, mockCtrl *gomock.Controller) (*mockschemaclientbound.MockSchemaClientBound, error)
GetSchemaClientBound creates a SchemaClientBound mock that responds to certain GetSchema requests
func GetStringTvProto ¶
func GetStringTvProto(s string) *sdcpb.TypedValue
GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte
func GetTestFilename ¶
func GetTestFilename() string
func GetUIntTvProto ¶
func GetUIntTvProto(i uint64) *sdcpb.TypedValue
GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte
func InitSDCIOSchema ¶
func InitSDCIOSchema() (dataschema.Client, *dConfig.SchemaConfig, error)
func LoadYgotStructIntoTreeRoot ¶ added in v0.0.58
func LoadYgotStructIntoTreeRoot(ctx context.Context, gs ygot.GoStruct, root api.Entry, owner string, prio int32, nonRevertive bool, flags *types.UpdateInsertFlags) (*types.ImportStats, error)
LoadYgotStructIntoTreeRoot loads a Ygot GoStruct into a tree root entry. This is a test helper function that converts a Ygot struct to JSON and imports it into the tree. Exported for use in other test packages.
func PathMapIndex ¶
PathMapIndex calculates a common map index for string slice based paths
func SplitStringSortDiff ¶ added in v0.0.63
SplitStringSortDiff split the two strings a and b on sep, sort alphabetical and return the diff
func UpdateSliceToStringSlice ¶ added in v0.0.56
UpdateSliceToStringSlice converts a []*Update to []string
Types ¶
type ImportStatsInterface ¶ added in v0.0.67
type UpdateParentMock ¶ added in v0.0.65
type UpdateParentMock struct {
// contains filtered or unexported fields
}
func NewUpdateParentMock ¶ added in v0.0.65
func NewUpdateParentMock(p *sdcpb.Path) *UpdateParentMock
func (*UpdateParentMock) SdcpbPath ¶ added in v0.0.65
func (p *UpdateParentMock) SdcpbPath() *sdcpb.Path