...

Source file src/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup_test.go

Documentation: github.com/Microsoft/hcsshim/internal/cpugroup

     1  //go:build windows
     2  
     3  package cpugroup
     4  
     5  import (
     6  	"context"
     7  	"testing"
     8  
     9  	"github.com/Microsoft/go-winio/pkg/guid"
    10  )
    11  
    12  // Unit tests for creating and deleting a CPU group on the host
    13  func TestCPUGroupCreateWithIDAndDelete(t *testing.T) {
    14  	t.Skip("only works on classic/core scheduler, skipping as we can't check this dynamically right now")
    15  
    16  	lps := []uint32{0, 1}
    17  	ctx, cancel := context.WithCancel(context.Background())
    18  	defer cancel()
    19  
    20  	id, err := guid.NewV4()
    21  	if err != nil {
    22  		t.Fatalf("failed to create cpugroup guid with: %v", err)
    23  	}
    24  
    25  	err = Create(ctx, id.String(), lps)
    26  	if err != nil {
    27  		t.Fatalf("failed to create cpugroup %s with: %v", id.String(), err)
    28  	}
    29  
    30  	defer func() {
    31  		if err := Delete(ctx, id.String()); err != nil {
    32  			t.Fatalf("failed to delete cpugroup %s with: %v", id.String(), err)
    33  		}
    34  	}()
    35  
    36  	_, err = GetCPUGroupConfig(ctx, id.String())
    37  	if err != nil {
    38  		t.Fatalf("failed to find cpugroup on host with: %v", err)
    39  	}
    40  }
    41  

View as plain text