testing

package
v2.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IntrospectionExtraHardwareJSONSample = `` /* 1227-byte string literal not displayed */

IntrospectionExtraHardwareJSONSample contains extra hardware sample data reported by the introspection process.

View Source
const IntrospectionListBody = `` /* 813-byte string literal not displayed */

IntrospectionListBody contains the canned body of a introspection.IntrospectionList response.

View Source
const IntrospectionNUMADataJSONSample = `` /* 605-byte string literal not displayed */

IntrospectionNUMADataJSONSample contains NUMA sample data reported by the introspection process.

View Source
const IntrospectionStatus = `` /* 336-byte string literal not displayed */

IntrospectionStatus contains the respnse of a single introspection satus.

Variables

View Source
var (
	IntrospectionFoo = introspection.Introspection{
		Finished:   true,
		State:      "finished",
		Error:      "",
		UUID:       "05ccda19-581b-49bf-8f5a-6ded99701d87",
		StartedAt:  fooTimeStarted,
		FinishedAt: fooTimeFinished,
		Links: []interface{}{
			map[string]interface{}{
				"href": "http://127.0.0.1:5050/v1/introspection/05ccda19-581b-49bf-8f5a-6ded99701d87",
				"rel":  "self",
			},
		},
	}

	IntrospectionBar = introspection.Introspection{
		Finished:   true,
		State:      "finished",
		Error:      "",
		UUID:       "c244557e-899f-46fa-a1ff-5b2c6718616b",
		StartedAt:  barTimeStarted,
		FinishedAt: barTimeFinished,
		Links: []interface{}{
			map[string]interface{}{
				"href": "http://127.0.0.1:5050/v1/introspection/c244557e-899f-46fa-a1ff-5b2c6718616b",
				"rel":  "self",
			},
		},
	}

	IntrospectionDataRes = introspection.Data{
		CPUArch: "x86_64",
		MACs:    []string{"52:54:00:4e:3d:30"},
		RootDisk: inventory.RootDiskType{
			Rotational: true,
			Model:      "",
			Name:       "/dev/vda",
			Size:       13958643712,
			Vendor:     "0x1af4",
		},
		Interfaces: map[string]introspection.BaseInterfaceType{
			"eth0": {
				IP:  "172.24.42.100",
				MAC: "52:54:00:4e:3d:30",
				PXE: true,
			},
		},
		CPUs:          2,
		BootInterface: "52:54:00:4e:3d:30",
		MemoryMB:      2048,
		IPMIAddress:   "192.167.2.134",
		Inventory:     inventorytesting.Inventory,
		Error:         "",
		LocalGB:       12,
		AllInterfaces: map[string]introspection.BaseInterfaceType{
			"eth1": {
				IP:  "172.24.42.101",
				MAC: "52:54:00:47:20:4d",
				PXE: false,
			},
			"eth0": {
				IP:  "172.24.42.100",
				MAC: "52:54:00:4e:3d:30",
				PXE: true,
				LLDPProcessed: map[string]interface{}{
					"switch_chassis_id":  "11:22:33:aa:bb:cc",
					"switch_system_name": "sw01-dist-1b-b12",
				},
			},
		},
		RawLLDP: map[string][]inventory.LLDPTLVType{
			"eth0": {
				{
					Type:  1,
					Value: "04112233aabbcc",
				},
				{
					Type:  5,
					Value: "737730312d646973742d31622d623132",
				},
			},
		},
	}

	IntrospectionExtraHardware = inventory.ExtraDataType{
		CPU: inventory.ExtraDataSection{
			"logical": map[string]interface{}{
				"number": float64(16),
			},
			"physical": map[string]interface{}{
				"clock": float64(2105032704),
				"cores": float64(8),
				"flags": "lm fpu fpu_exception wp vme de",
			},
		},
		Disk: inventory.ExtraDataSection{
			"sda": map[string]interface{}{
				"rotational": float64(1),
				"vendor":     "TEST",
			},
		},
		Firmware: inventory.ExtraDataSection{
			"bios": map[string]interface{}{
				"date":   "01/01/1970",
				"vendor": "test",
			},
		},
		IPMI: inventory.ExtraDataSection{
			"Fan1A RPM": map[string]interface{}{
				"unit":  "RPM",
				"value": float64(3120),
			},
			"Fan1B RPM": map[string]interface{}{
				"unit":  "RPM",
				"value": float64(2280),
			},
		},
		Memory: inventory.ExtraDataSection{
			"bank0": map[string]interface{}{
				"clock":       1600000000.0,
				"description": "DIMM DDR3 Synchronous Registered (Buffered) 1600 MHz (0.6 ns)",
			},
			"bank1": map[string]interface{}{
				"clock":       1600000000.0,
				"description": "DIMM DDR3 Synchronous Registered (Buffered) 1600 MHz (0.6 ns)",
			},
		},
		Network: inventory.ExtraDataSection{
			"em1": map[string]interface{}{
				"Autonegotiate": "on",
				"loopback":      "off [fixed]",
			},
			"p2p1": map[string]interface{}{
				"Autonegotiate": "on",
				"loopback":      "off [fixed]",
			},
		},
		System: inventory.ExtraDataSection{
			"ipmi": map[string]interface{}{
				"channel": float64(1),
			},
			"kernel": map[string]interface{}{
				"arch":    "x86_64",
				"version": "3.10.0",
			},
			"motherboard": map[string]interface{}{
				"vendor": "Test",
			},
			"product": map[string]interface{}{
				"name":   "test",
				"vendor": "Test",
			},
		},
	}

	IntrospectionNUMA = inventory.NUMATopology{
		CPUs: []inventory.NUMACPU{
			{
				CPU:            6,
				NUMANode:       1,
				ThreadSiblings: []int{3, 27},
			},
			{
				CPU:            10,
				NUMANode:       0,
				ThreadSiblings: []int{20, 44},
			},
		},
		NICs: []inventory.NUMANIC{
			{
				Name:     "p2p1",
				NUMANode: 0,
			},
			{
				Name:     "p2p2",
				NUMANode: 1,
			},
		},
		RAM: []inventory.NUMARAM{
			{
				NUMANode: 0,
				SizeKB:   99289532,
			},
			{
				NUMANode: 1,
				SizeKB:   100663296,
			},
		},
	}
)
View Source
var IntrospectionDataJSONSample = fmt.Sprintf(`
{
    "all_interfaces": {
        "eth0": {
            "client_id": null,
            "ip": "172.24.42.100",
            "lldp_processed": {
                "switch_chassis_id": "11:22:33:aa:bb:cc",
                "switch_system_name": "sw01-dist-1b-b12"
            },
            "mac": "52:54:00:4e:3d:30",
            "pxe": true
        },
        "eth1": {
            "client_id": null,
            "ip": "172.24.42.101",
            "mac": "52:54:00:47:20:4d",
            "pxe": false
        }
    },
    "boot_interface": "52:54:00:4e:3d:30",
    "cpu_arch": "x86_64",
    "cpus": 2,
    "error": null,
    "interfaces": {
        "eth0": {
            "client_id": null,
            "ip": "172.24.42.100",
            "mac": "52:54:00:4e:3d:30",
            "pxe": true
        }
    },
    "inventory": %s,
    "ipmi_address": "192.167.2.134",
    "lldp_raw": {
	"eth0": [
	    [
		1,
		"04112233aabbcc"
	    ],
	    [
		5,
		"737730312d646973742d31622d623132"
	    ]
	]
    },
    "local_gb": 12,
    "macs": [
        "52:54:00:4e:3d:30"
    ],
    "memory_mb": 2048,
    "root_disk": {
        "hctl": null,
        "model": "",
        "name": "/dev/vda",
        "rotational": true,
        "serial": null,
        "size": 13958643712,
        "vendor": "0x1af4",
        "wwn": null,
        "wwn_vendor_extension": null,
        "wwn_with_extension": null
    }
}
`, inventorytesting.InventorySample)

IntrospectionDataJSONSample contains sample data reported by the introspection process.

Functions

func HandleAbortIntrospectionSuccessfully

func HandleAbortIntrospectionSuccessfully(t *testing.T)

HandleAbortIntrospectionSuccessfully sets up the test server to respond to an AbortIntrospection request.

func HandleGetIntrospectionDataSuccessfully

func HandleGetIntrospectionDataSuccessfully(t *testing.T)

HandleGetIntrospectionDataSuccessfully sets up the test server to respond to a GetIntrospectionData request.

func HandleGetIntrospectionStatusSuccessfully

func HandleGetIntrospectionStatusSuccessfully(t *testing.T)

HandleGetIntrospectionStatusSuccessfully sets up the test server to respond to a GetIntrospectionStatus request.

func HandleListIntrospectionsSuccessfully

func HandleListIntrospectionsSuccessfully(t *testing.T)

HandleListIntrospectionsSuccessfully sets up the test server to respond to a server ListIntrospections request.

func HandleReApplyIntrospectionSuccessfully

func HandleReApplyIntrospectionSuccessfully(t *testing.T)

HandleReApplyIntrospectionSuccessfully sets up the test server to respond to a ReApplyIntrospection request.

func HandleStartIntrospectionSuccessfully

func HandleStartIntrospectionSuccessfully(t *testing.T)

HandleStartIntrospectionSuccessfully sets up the test server to respond to a StartIntrospection request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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