fake

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OSDDeviceClassOutput added in v1.6.6

func OSDDeviceClassOutput(osdId string) string

OSDDeviceClassOutput returns JSON output from 'ceph osd crush get-device-class' that can be used for unit tests. osdId is a osd ID to get from crush map. If ID is empty raise a fake error.

func OsdLsOutput

func OsdLsOutput(numOSDs int) string

OsdLsOutput returns JSON output from 'ceph osd ls' that can be used for unit tests. It returns output for a Ceph cluster with the number of OSDs given as input starting with ID 0. example: numOSDs = 5 => return: "[0,1,2,3,4]"

func OsdOkToStopOutput

func OsdOkToStopOutput(queriedID int, returnOsdIds []int) string

OsdOkToStopOutput returns JSON output from 'ceph osd ok-to-stop' that can be used for unit tests. queriedID should be given as the ID sent to the 'osd ok-to-stop <id> [--max=N]' command. It will be returned with relevant NOT ok-to-stop results. If returnOsdIds is empty, this returns a NOT ok-to-stop result. Otherwise, it returns an ok-to-stop result. returnOsdIds should include queriedID if the result should be successful.

func OsdTreeOutput

func OsdTreeOutput(numNodes, numOSDsPerNode int) string

OsdTreeOutput returns JSON output from 'ceph osd tree' that can be used for unit tests. It returns output for a Ceph cluster with the given number of nodes and the given number of OSDs per node with no complex configuration. This should work even for 0 nodes.

example:  OsdTreeOutput(3, 3) // returns JSON output for the Ceph cluster below
    node0:       node1:      node2:
      - osd0      - osd1      - osd2
      - osd3      - osd4      - osd5
      - osd6      - osd7      - osd8

Types

This section is empty.

Jump to

Keyboard shortcuts

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