fixture

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	AnyValue = Any("any-value-is-ok")
	NilValue = Nil("this-field-is-not-present")
	OrKey    = "||"
)

Variables

View Source
var (
	ExpectedMetadataDelta = []*inventoryapi.RawDelta{
		{
			Source:   "metadata/host_aliases",
			ID:       1,
			FullDiff: true,
			Diff: map[string]interface{}{
				"display_name": map[string]interface{}{
					"alias": "display-name",
					"id":    "display_name",
				},
				"hostname": map[string]interface{}{
					"id":    "hostname",
					"alias": "foobar",
				},
				"hostname_short": map[string]interface{}{
					"id":    "hostname_short",
					"alias": "foo",
				},
			},
		},
		{
			Source:   "metadata/agent_config",
			ID:       1,
			FullDiff: true,
			Diff: map[string]interface{}{

				"infrastructure": map[string]interface{}{
					"display_name": map[string]interface{}{"value": "display-name"},
					"max_procs":    AnyValue,
				},
			},
		},
	}

	ExpectedSysctlDelta = []*inventoryapi.RawDelta{
		{
			Source:   "kernel/sysctl",
			ID:       1,
			FullDiff: true,

			Diff: map[string]interface{}{
				".fs.file-max":    AnyValue,
				".fs.overflowgid": AnyValue,
				".fs.overflowuid": AnyValue,
				".kernel.acct": map[string]interface{}{
					"id":           ".kernel.acct",
					"sysctl_value": AnyValue,
				},
				".kernel.ctrl-alt-del": AnyValue,
				".kernel.domainname":   AnyValue,
				".kernel.hostname":     AnyValue,
				".kernel.modprobe":     AnyValue,
				".kernel.msgmax":       AnyValue,
				".kernel.msgmnb":       AnyValue,
				".kernel.panic": map[string]interface{}{
					"id":           ".kernel.panic",
					"sysctl_value": AnyValue,
				},
				".kernel.printk":             AnyValue,
				".vm.dirty_background_ratio": AnyValue,
			},
		},
	}
)

Functions

func AssertRequestContainsInventoryDeltas

func AssertRequestContainsInventoryDeltas(t assert.TestingT, req http.Request, expected []*inventoryapi.RawDelta)

AssertRequestContainsInventoryDeltas checks, for each RawDelta entry, that is is contained in the request as a subset of all the entries.

Types

type Any

type Any string

type ContainsString

type ContainsString string

type Nil

type Nil string

Jump to

Keyboard shortcuts

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