test

package
v6.0.0+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package test is using for HuaWei Ascend pin scheduling test.

Package test is using for HuaWei Ascend pin scheduling test.

Package test is using for HuaWei Ascend pin scheduling test.

Package test is using for HuaWei Ascend pin scheduling test.

Package test is using for HuaWei Ascend pin fault rescheduling.

Package test is using for HuaWei Ascend pin scheduling test.

Index

Constants

View Source
const (

	// NPUIndex4 for re-scheduler tests
	NPUIndex4 = 4
	// NPUIndex5 for re-scheduler tests
	NPUIndex5 = 5
	// NPUIndex8 for re-scheduler tests
	NPUIndex8 = 8
	// NPUHexKilo for const 1000,volcano frame used.
	NPUHexKilo = 1000

	// NPU910CardName 910 card name
	NPU910CardName = "huawei.com/Ascend910"
	// AscendNPUPodRealUse for NPU pod real use cards.
	AscendNPUPodRealUse = "huawei.com/AscendReal"
	// FakeUpdateTime fake update time for test
	FakeUpdateTime = int64(11110)
	// FakeJobName fake job namespace/name
	FakeJobName = "vcjob/job"
	// FakeTaskName0 fake task name
	FakeTaskName0 = "vcjob-pod0"
	// FakeTaskName1 fake task name
	FakeTaskName1 = "vcjob-pod1"
)

Variables

This section is empty.

Functions

func AddConfigIntoFakeSSN

func AddConfigIntoFakeSSN(ssn *framework.Session, configs []conf.Configuration)

AddConfigIntoFakeSSN Add test node into fake SSN.

func AddFakeTaskResReq

func AddFakeTaskResReq(vTask *api.TaskInfo, name string, value float64)

AddFakeTaskResReq add require resource of fake task.

func AddJobIntoFakeSSN

func AddJobIntoFakeSSN(ssn *framework.Session, info ...*api.JobInfo)

AddJobIntoFakeSSN Add test job into fake SSN.

func AddResource

func AddResource(resourceList v1.ResourceList, name v1.ResourceName, need string)

AddResource add resource into resourceList

func AddTestJobLabel

func AddTestJobLabel(job *api.JobInfo, labelKey, labelValue string)

AddTestJobLabel add test job's label.

func AddTestJobPodGroup

func AddTestJobPodGroup(job *api.JobInfo)

AddTestJobPodGroup set test job pg.

func AddTestTaskLabel

func AddTestTaskLabel(task *api.TaskInfo, labelKey, labelValue string)

AddTestTaskLabel add test job's label.

func BuildNPUNode

func BuildNPUNode(node NPUNode) *v1.Node

BuildNPUNode built NPU node object

func BuildNPUPod

func BuildNPUPod(pod NPUPod) *v1.Pod

BuildNPUPod built Pod object

func BuildPodWithReqResource

func BuildPodWithReqResource(resourceName v1.ResourceName, resourceNum string) *v1.Pod

BuildPodWithReqResource build pod with request resource

func BuildTestTaskWithAnnotation

func BuildTestTaskWithAnnotation(npuName, npuNum, npuAllocate string) *api.TaskInfo

BuildTestTaskWithAnnotation build test task with annotation

func FakeNormalSSN

func FakeNormalSSN() *framework.Session

FakeNormalSSN fake normal test ssn.

func FakeNormalTestJob

func FakeNormalTestJob(jobName string, taskNum int) *api.JobInfo

FakeNormalTestJob make normal test job.

func FakeNormalTestJobByCreatTime

func FakeNormalTestJobByCreatTime(jobName string, taskNum int, creatTime int64) *api.JobInfo

FakeNormalTestJobByCreatTime make normal test job by create time.

func FakeNormalTestNode

func FakeNormalTestNode(name string) *api.NodeInfo

FakeNormalTestNode fake normal test node.

func FakeNormalTestNodes

func FakeNormalTestNodes(num int) []*api.NodeInfo

FakeNormalTestNodes fake normal test nodes.

func FakeNormalTestTask

func FakeNormalTestTask(name string, nodename string, groupname string) *api.TaskInfo

FakeNormalTestTask fake normal test task.

func FakeNormalTestTasks

func FakeNormalTestTasks(num int) []*api.TaskInfo

FakeNormalTestTasks fake normal test tasks.

func FakeSSNReSchedule

func FakeSSNReSchedule() *framework.Session

FakeSSNReSchedule fake normal test ssn 2jobs.

func FakeTaskWithResReq

func FakeTaskWithResReq(name, resName string, resNum int) *api.TaskInfo

FakeTaskWithResReq fake task with resource require

func FakeVNPUTestTask

func FakeVNPUTestTask(name string, nodename string, groupname string, num int) *api.TaskInfo

FakeVNPUTestTask fake vnpu test task.

func PatchReset

func PatchReset(patch *gomonkey.Patches)

PatchReset go monkey patch reset

func SetFakeJobRequestSource

func SetFakeJobRequestSource(fJob *api.JobInfo, name string, value int)

SetFakeJobRequestSource add job require on total,task.

func SetFakeJobResRequest

func SetFakeJobResRequest(fJob *api.JobInfo, name v1.ResourceName, need string)

SetFakeJobResRequest set fake

func SetFakeNPUJobErrors

func SetFakeNPUJobErrors(fJob *api.JobInfo, msg string)

SetFakeNPUJobErrors set job and it's tasks to pending status.

func SetFakeNPUJobStatusPending

func SetFakeNPUJobStatusPending(fJob *api.JobInfo)

SetFakeNPUJobStatusPending set job and it's tasks to pending status.

func SetFakeNPUPodStatus

func SetFakeNPUPodStatus(fPod *v1.Pod, status v1.PodPhase)

SetFakeNPUPodStatus set fake pod status.

func SetFakeNPUTaskStatus

func SetFakeNPUTaskStatus(fTask *api.TaskInfo, status api.TaskStatus)

SetFakeNPUTaskStatus task set same status.

func SetFakeNodeSource

func SetFakeNodeSource(nodeInf *api.NodeInfo, name string, value int)

SetFakeNodeSource Set fake node the idle, Capability, Allocatable source.

func SetTestJobPodGroupPendingStatus

func SetTestJobPodGroupPendingStatus(job *api.JobInfo)

SetTestJobPodGroupPendingStatus set test job's PodGroupStatus

func SetTestNPUPodAnnotation

func SetTestNPUPodAnnotation(pod *v1.Pod, annotationKey string, annotationValue string)

SetTestNPUPodAnnotation set NPU pod annotation for add pod use npu resource.

Types

type NPUNode

type NPUNode struct {
	Name                         string
	Capacity, Allocatable        v1.ResourceList
	Labels, Selector, Annotation map[string]string
	Other                        map[string]interface{}
}

NPUNode test NPU node struct

type NPUPod

type NPUPod struct {
	Namespace, Name, NodeName, GroupName string
	Phase                                v1.PodPhase
	ReqSource                            v1.ResourceList
	Labels, Selector                     map[string]string
}

NPUPod test NPU pod struct

Jump to

Keyboard shortcuts

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