@@ -387,6 +387,42 @@ func TestRegisterHAMi(t *testing.T) {
387387 },
388388 },
389389 },
390+ {
391+ name : "IsHamiVnpuCore_Devcore100" ,
392+ args : registerHAMiArgs {
393+ nodeName : "test-node" ,
394+ registerAnno : "hami.io/node-register-Ascend310P" ,
395+ handshakeAnno : "hami.io/node-handshake-Ascend310P" ,
396+ mgr : & FakeManager {
397+ GetDevicesFunc : func () []* manager.Device {
398+ return []* manager.Device {
399+ {UUID : "uuid1" , Memory : 21527 , AICore : 8 , Health : true },
400+ }
401+ },
402+ VDeviceCountFunc : func () int { return 1 },
403+ CommonWordFunc : func () string { return "Ascend310P" },
404+ IsHamiVnpuCoreFunc : func () bool { return true },
405+ },
406+ nodes : []* v1.Node {
407+ {ObjectMeta : metav1.ObjectMeta {Name : "test-node" , Annotations : map [string ]string {}}},
408+ },
409+ },
410+ want : registerHAMiWant {
411+ deviceCount : 1 ,
412+ deviceCheck : func (t * testing.T , devs []* device.DeviceInfo ) {
413+ t .Helper ()
414+ if devs [0 ].Devcore != HamiVnpuCoreMaxPercent {
415+ t .Fatalf ("device Devcore = %d, want %d in hami-vnpu-core mode" , devs [0 ].Devcore , HamiVnpuCoreMaxPercent )
416+ }
417+ },
418+ annotationCheck : func (t * testing.T , annos map [string ]string ) {
419+ t .Helper ()
420+ if annos [VNPUNodeSelectorAnnotation ] != "true" {
421+ t .Fatalf ("VNPUNodeSelectorAnnotation = %q, want 'true'" , annos [VNPUNodeSelectorAnnotation ])
422+ }
423+ },
424+ },
425+ },
390426 {
391427 name : "IsHamiVnpuCore_False" ,
392428 args : registerHAMiArgs {
0 commit comments